Inventory.group

Groups an item type into the given slot, if possible.

class Inventory
@trusted
void
group
(
size_t index
)

Parameters

index size_t

the index of the slot where the items should be grouped

Examples

auto inventory = new Inventory(10);
inventory[0..3] = Slot(new Items.Cookie(), 30);
inventory.group(0);
assert(inventory[0].count == 64);
assert(inventory[1].count == 0);
assert(inventory[2].count == 26);

Meta