Inventory class
A collection of Item and Currency
Constructors
Properties
Methods
-
addCurrency(
{required Currency currency, int quantity = 1}) → dynamic -
Add a new
Currencyto the inventory or update the existingCurrencyinventory by increasing the amount byquantity -
addItem(
{required Item item, int quantity = 1}) → dynamic -
Add a new
Itemto the inventory or update the existingIteminventory by increasing the amount byquantity -
getCurrency(
{required Currency currency}) → int? -
Returns the quantity of a certain
Currencythat the user holds in their inventory. -
getItem(
{required Item item}) → int? -
Returns the quantity of a certain
Itemthat 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