Versions in this module Expand all Collapse all v0 v0.0.4 Jan 4, 2021 Changes in this version + var ErrSlotLocked = errors.New("slot is locked and cannot be edited") + var ErrSlotOutOfRange = errors.New("slot is out of range: must be in range 0 <= slot < inventory.Size()") + type Armour struct + func NewArmour(f func(slot int, item item.Stack)) *Armour + func (a *Armour) All() []item.Stack + func (a *Armour) Boots() item.Stack + func (a *Armour) Chestplate() item.Stack + func (a *Armour) Clear() + func (a *Armour) Close() error + func (a *Armour) Helmet() item.Stack + func (a *Armour) Inv() *Inventory + func (a *Armour) Leggings() item.Stack + func (a *Armour) SetBoots(boots item.Stack) + func (a *Armour) SetChestplate(chestplate item.Stack) + func (a *Armour) SetHelmet(helmet item.Stack) + func (a *Armour) SetLeggings(leggings item.Stack) + func (a *Armour) String() string + type Inventory struct + func New(size int, f func(slot int, item item.Stack)) *Inventory + func (inv *Inventory) AddItem(it item.Stack) (n int, err error) + func (inv *Inventory) All() []item.Stack + func (inv *Inventory) Clear() + func (inv *Inventory) Close() error + func (inv *Inventory) Contents() []item.Stack + func (inv *Inventory) Empty() bool + func (inv *Inventory) First(item item.Stack) (int, bool) + func (inv *Inventory) FirstEmpty() (int, bool) + func (inv *Inventory) Item(slot int) (item.Stack, error) + func (inv *Inventory) LockSlot(slot int) + func (inv *Inventory) RemoveItem(it item.Stack) error + func (inv *Inventory) SetItem(slot int, item item.Stack) error + func (inv *Inventory) Size() int + func (inv *Inventory) SlotLocked(slot int) bool + func (inv *Inventory) String() string + func (inv *Inventory) Swap(slotA, slotB int) error + func (inv *Inventory) UnlockSlot(slot int)