-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitems.go
59 lines (51 loc) · 1.19 KB
/
items.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package main
import (
"strings"
)
type uniqueItem struct {
Id string
Name string
Corrupted bool
OriginalPrice price
}
type currencyItem struct {
Id string
Type string
OriginalPrice price
OriginalQuantity int
}
type divinationCardItem struct {
Id string
Name string
Mods string
MaxStackSize int
OriginalPrice price
OriginalQuantity int
}
func getUniqueFromStashItem(si stashItem) uniqueItem {
u := uniqueItem{Name: si.Name}
u.Id = si.Id
u.Corrupted = si.Corrupted
u.OriginalPrice = interpretPrice(si.Note)
return u
}
func getCurrencyFromStashItem(si stashItem) currencyItem {
c := currencyItem{Type: si.TypeLine}
c.Id = si.Id
c.Type = si.TypeLine
c.OriginalPrice = interpretPrice(si.Note)
c.OriginalQuantity = si.StackSize
return c
}
func getDivinationFromStashItem(si stashItem) divinationCardItem {
d := divinationCardItem{Name: si.TypeLine}
d.Id = si.Id
d.Mods = strings.Join(si.ExplicitMods[:], ",")
d.MaxStackSize = si.MaxStackSize
d.OriginalPrice = interpretPrice(si.Note)
d.OriginalQuantity = si.StackSize
return d
}
func formatPrice(raw string) float64 {
return 1.12
}