add new location types and enhance inventory structure for shared stash support and DLC support.
This commit is contained in:
@@ -10,18 +10,21 @@ type Location struct {
|
||||
|
||||
const (
|
||||
// Storage locations
|
||||
LocationUnknown LocationType = "unknown"
|
||||
LocationInventory LocationType = "inventory"
|
||||
LocationStash LocationType = "stash"
|
||||
LocationSharedStash LocationType = "shared_stash"
|
||||
LocationBelt LocationType = "belt"
|
||||
LocationCube LocationType = "cube"
|
||||
LocationVendor LocationType = "vendor"
|
||||
LocationGround LocationType = "ground"
|
||||
LocationSocket LocationType = "socket"
|
||||
LocationCursor LocationType = "cursor"
|
||||
LocationEquipped LocationType = "equipped"
|
||||
LocationMercenary LocationType = "mercenary"
|
||||
LocationUnknown LocationType = "unknown"
|
||||
LocationInventory LocationType = "inventory"
|
||||
LocationStash LocationType = "stash"
|
||||
LocationSharedStash LocationType = "shared_stash"
|
||||
LocationBelt LocationType = "belt"
|
||||
LocationCube LocationType = "cube"
|
||||
LocationVendor LocationType = "vendor"
|
||||
LocationGround LocationType = "ground"
|
||||
LocationSocket LocationType = "socket"
|
||||
LocationCursor LocationType = "cursor"
|
||||
LocationEquipped LocationType = "equipped"
|
||||
LocationMercenary LocationType = "mercenary"
|
||||
LocationGemsTab LocationType = "gems_tab"
|
||||
LocationMaterialsTab LocationType = "materials_tab"
|
||||
LocationRunesTab LocationType = "runes_tab"
|
||||
|
||||
// Body locations
|
||||
LocNone LocationType = "none"
|
||||
|
||||
@@ -8,10 +8,11 @@ import (
|
||||
)
|
||||
|
||||
type Inventory struct {
|
||||
Belt Belt
|
||||
AllItems []Item
|
||||
Gold int
|
||||
StashedGold [4]int
|
||||
Belt Belt
|
||||
AllItems []Item
|
||||
Gold int
|
||||
StashedGold [6]int // [0]=personal, [1..5]=shared stash pages
|
||||
SharedStashPages int // Number of shared stash units detected (3=non-DLC, 5+=DLC)
|
||||
}
|
||||
|
||||
func (i Inventory) Find(name item.Name, locations ...item.LocationType) (Item, bool) {
|
||||
|
||||
Reference in New Issue
Block a user