Documentation ¶
Overview ¶
Package inv provides an item and inventory system.
Index ¶
- type Inv
- type InvTable
- type Item
- type ItemTable
- type Prod
- type ProdTable
- type Sys
- func (s *Sys) DelInv(id ids.Inv) error
- func (s *Sys) DelItem(id ids.Item) error
- func (s *Sys) DelProd(id ids.Prod) error
- func (s *Sys) Move(id ids.Item, to ids.Inv, pos *geo.Pos) error
- func (s *Sys) NewInv(dim geo.Dim) (*Inv, error)
- func (s *Sys) NewItem(prod *Prod) (*Item, error)
- func (s *Sys) NewProd(name string) (*Prod, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Inv ¶
Inv is an inventory or container for items.
func (*Inv) MarshalBinary ¶
func (*Inv) UnmarshalBinary ¶
type Item ¶
type Item struct { ID ids.Item `json:"id"` Prod ids.Prod `json:"prod"` Inv ids.Inv `json:"inv"` geo.Box Sub ids.Inv `json:"sub,omitempty"` }
Item is an unique instance of a product in an inventory.
func (*Item) MarshalBinary ¶
func (*Item) UnmarshalBinary ¶
type Prod ¶
type Prod struct { ID ids.Prod `json:"id"` Name string `json:"name"` geo.Dim Asset ids.Topic `json:"asset,omitempty"` Text string `json:"text,omitempty"` }
Prod represents an abstract product or item type that has common attributes.
func (*Prod) MarshalBinary ¶
func (*Prod) UnmarshalBinary ¶
Click to show internal directories.
Click to hide internal directories.