Inventory.opIndexAssign

Sets the slots in the given range.

  1. void opIndexAssign(Slot slot, size_t index)
  2. void opIndexAssign(Slot slot, Slice slice)
    class Inventory
    @safe
    void
    opIndexAssign
    (,
    Slice slice
    )
  3. void opIndexAssign(Slot[] slots, Slice slice)

Parameters

slot Slot

the slot to be set

slice Slice

the range to set

Throws

RangeError is an invalid range or index is given

Examples

inventory[2..4] = Slot(new Items.Apple(), 32);
inventory[4..6] = another[10..12];

Meta