Inventory.opEquals

Compares the inventory with an array of slots.

  1. bool opEquals(Slot[] slots)
  2. bool opEquals(Object object)
    class Inventory
    override
    bool
    opEquals
    (
    Object object
    )

Return Value

Type: bool

true if the length and the item at every index is equals to the array's ones

Examples

auto inventory = new Inventory(Slot(null), Slot(new Items.Apple()));
assert(inventory == [Slot(null), Slot(new Items.Apple())]);
assert(inventory != [Slot(null), Slot(new Items.Apple(), 12)]);
assert(inventory != [Slot(null), Slot(new Items.Apple("{\"customName\":\"test\"}"))]);

Meta