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)
  4. uint opOpAssign(T[] items)
    class Inventory
    @safe
    uint
    opOpAssign
    (
    string op
    T
    )
    (
    T[] items
    )
    if (
    op == "-" &&
    (
    is(T == Slot) ||
    is(T == Item)
    )
    )
  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