-
- All Known Implementing Classes:
Inventory
public interface IInventory
- Author:
- Jeff Riggle
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addItem(IItem item, int amount)
void
addItemChangeListener(ChangeListener<IItem> listener)
This is used to allow a consumer to be notified when any item is added, changed or removed.void
addItems(Map<IItem,Integer> items)
void
clearItems()
Clears all of the items from the inventory.int
getAmount(IItem item)
List<IItem>
items()
void
removeItem(IItem item)
void
removeItemChangeListener(ChangeListener<IItem> listener)
This is used to stop a consumer from receiving notifications when items are added, changed or removed.void
removeItems(List<IItem> items)
void
setAmount(IItem item, int amount)
-
-
-
Method Detail
-
getAmount
int getAmount(IItem item)
- Parameters:
item
- The item you would like an amount for.- Returns:
- How many of that item is in the inventory.
-
setAmount
void setAmount(IItem item, int amount)
- Parameters:
item
- The item that you would like to change the amount of.amount
- The amount to change to.
-
addItem
void addItem(IItem item, int amount)
- Parameters:
item
- The item to be added to the inventory.amount
- The amount of that item to add to the inventory.
-
addItems
void addItems(Map<IItem,Integer> items)
- Parameters:
items
- A map of items and there amounts to be added to the inventory.
-
removeItem
void removeItem(IItem item)
- Parameters:
item
- The item to remove from the inventory.
-
removeItems
void removeItems(List<IItem> items)
- Parameters:
items
- The items to remove from the inventory.
-
clearItems
void clearItems()
Clears all of the items from the inventory.
-
addItemChangeListener
void addItemChangeListener(ChangeListener<IItem> listener)
This is used to allow a consumer to be notified when any item is added, changed or removed.- Parameters:
listener
- A @see ChangeListener to be notified whenever this item is added, changed or removed.
-
removeItemChangeListener
void removeItemChangeListener(ChangeListener<IItem> listener)
This is used to stop a consumer from receiving notifications when items are added, changed or removed.- Parameters:
listener
- A @see ChangeListener to be notified whenever this item is added, changed or removed.
-
-