Gets every slots of the inventory (0..$). This property should only be used when the full inventory is needed, otherwise opIndex should be used for getting a slot in a specific index or in a specific range.
Gets the slot at the given index.
Gets the slots in a specific range.
Sets the slot at the given index.
Sets the slots in the given range.
Gets the size of the inventory.
Concatenates two inventories (or an inventory and an array of slots) and returns a new one.
Adds slot(s) to the inventory (if there's enough space). Note that this function will only mutate the the inventory's slots' content without mutating its length.
Removes slot(s) from the inventory. Parameter types: string = tries to remove items with the same name string[] = tries to remove items with one of the names in the array Item = tries to remove items with the same name and properties Slot = tries to remove items with the same name, properties and count
Matches the first occurence and returns the pointer to the slot. Paramenter types: string = checks for an item with the same name string[] = checks for an item with one of the names in the array Item = checks for an item with the same name and properties (custom name, enchantments, ...) Slot = checks for the item (see above) and the count of the item
Groups an item type into the given slot, if possible.
Performs a basic math operation on every slot's count in the inventory, if not empty.
Checks whether or not the inventory is empty.
Removes every item from inventory if empty is true.
Compares the inventory with an array of slots.
Returns a string with representing the inventory and its array of slots.
auto inv = new Inventory(4); auto ig = new InventoryGroup(inv[2..$], inv[0..2]); ig += new Items.Apple(); assert(inv == [Slot(null), Slot(null), Slot(new Items.Apple()), Slot(null)]);
Group of inventories that acts as one.
This class can be used to change the operation order in a normal inventory.