|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinventory.Inventory
public class Inventory
This class represents the players inventory.
Constructor Summary | |
---|---|
Inventory(int width,
int height,
com.golden.gamedev.engine.BaseInput bsInput)
Creates an inventory area that can store and display items. |
Method Summary | |
---|---|
void |
addItemToInventory(Item item)
Adds an item to the inventory |
java.util.LinkedList<Item> |
getInventoryItems()
Returns a list with the items in the players inventory |
Item |
getSelectedInventoryItem()
Returns the currently selected inventory item. |
boolean |
hasItem(Item item)
Determines whether the inventory contains the specified item |
boolean |
isLookingAtInventory()
Determines whether the player is currently looking at the inventory. |
void |
removeItem(Item item)
Removes an item from the inventory. |
void |
render(java.awt.Graphics2D g)
Draws the inventory area with all its items if the mouse is located within the area's bounds |
void |
setSelectedInventoryItem(Item inventItem)
Sets the currently selected inventory item to the specified item. |
void |
update(long elapsedTime)
Updates the inventory items, especially their hotspots in the inventory area |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Inventory(int width, int height, com.golden.gamedev.engine.BaseInput bsInput)
width
- width of the inventory areaheight
- height of the inventory areabsInput
- Method Detail |
---|
public java.util.LinkedList<Item> getInventoryItems()
public void addItemToInventory(Item item)
item
- Item that shall be added to the inventorypublic void removeItem(Item item)
item
- item to remove from the inventorypublic boolean isLookingAtInventory()
public Item getSelectedInventoryItem()
public boolean hasItem(Item item)
item
- item to check for existence in the inventory
public void setSelectedInventoryItem(Item inventItem)
inventItem
- item to set to the seleceted inventory itempublic void render(java.awt.Graphics2D g)
g
- public void update(long elapsedTime)
elapsedTime
- time between two frames
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |