auto inventory = new Inventory(new Items.Apple(), Slot(new Items.Cookie(), 12)); inventory += 40; assert(inventory == [Slot(new Items.Apple(), 64), Slot(new Items.Cookie(), 52)]); inventory -= 52; assert(inventory == [Slot(new Items.Apple(), 12), Slot(null)]); inventory *= 4; assert(inventory == [Slot(new Items.Apple(), 48), Slot(null)]); inventory /= 24; assert(inventory == [Slot(new Items.Apple(), 2), Slot(null)]);
Performs a basic math operation on every slot's count in the inventory, if not empty.