Inventory.opOpAssign

Removes slot(s) from the inventory. Parameter types: string = tries to remove items with the same name string[] = tries to remove items with one of the names in the array Item = tries to remove items with the same name and properties Slot = tries to remove items with the same name, properties and count

  1. Slot opOpAssign(Slot slot)
  2. Slot[] opOpAssign(Slot[] slots)
  3. uint opOpAssign(T item)
    class Inventory
    @trusted
    uint
    opOpAssign
    (
    string op
    T
    )
    ()
    if (
    op == "-" &&
    (
    is(T == Slot) ||
    is(T : Item)
    ||
    is(T == string)
    ||
    is(T == string[])
    ||
    is(T == immutable(string)[])
    )
    )
  4. uint opOpAssign(T[] items)
  5. void opOpAssign(T number)

Return Value

Type: uint

the number of slots that has been set to empty

Examples

inventory -= Items.FOOD;          // remove food
inventory -= new Items.Apple();   // remove apples

Meta