discontinuedPackage powerd6 has been discontinued.

Inventory class

A collection of Item and Currency

Constructors

Inventory()

Properties

currencies ↔ Map<Currency, int>
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
items ↔ Map<Item, int>
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addCurrency({required Currency currency, int quantity = 1}) → dynamic
Add a new Currency to the inventory or update the existing Currency inventory by increasing the amount by quantity
addItem({required Item item, int quantity = 1}) → dynamic
Add a new Item to the inventory or update the existing Item inventory by increasing the amount by quantity
getCurrency({required Currency currency}) → int?
Returns the quantity of a certain Currency that the user holds in their inventory.
getItem({required Item item}) → int?
Returns the quantity of a certain Item that the user holds in their inventory.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited