Inventory.opIndex

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.

Return Value

Type: Slot[]

an array with every slot in the inventory

Examples

auto inventory = new Inventory(2);
assert(inventory[] == [Slot(null), Slot(null)]);
assert(cast(Slot[])inventory == inventory[]);

Meta