PlayerInventory.opIndexAssign

Sets a slot using a string, creating the Item object from the holder's world's items.

See the superclass's opIndexAssign documentation for more informations about this function.

  1. void opIndexAssign(Slot item, size_t index)
  2. void opIndexAssign(item_t item, size_t index)
    class PlayerInventory
    void
    opIndexAssign
    (,
    size_t index
    )

Examples

player.inventory[1] = Items.APPLE;
assert(player.inventory[1] == Slot(new Items.Apple());

Meta