Inventory.opBinaryRight

Concatenates two inventories (or an inventory and an array of slots) and returns a new one.

  1. Inventory opBinaryRight(Slot[] slots)
    class Inventory
    @safe
    opBinaryRight
    (
    string op
    )
    if (
    op == "~"
    )
  2. Inventory opBinaryRight(Slot slot)

Examples

auto inventory = new Inventory(4);
auto ni = inventory ~ [Slot(null), Slot(null)] ~ inventory;
assert(inventory.length == 4);
assert(ni.length == 10);

Meta