Inventory class
A collection of Item
and Currency
Constructors
Properties
Methods
-
addCurrency(
{required Currency currency, int quantity = 1}) → dynamic -
Add a new
Currency
to the inventory or update the existingCurrency
inventory by increasing the amount byquantity
-
addItem(
{required Item item, int quantity = 1}) → dynamic -
Add a new
Item
to the inventory or update the existingItem
inventory by increasing the amount byquantity
-
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