|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.rico.adventure.inventory.AbstractInventory
public abstract class AbstractInventory
Abstract base class for different kinds of inventory systems.
Constructor Summary | |
---|---|
AbstractInventory(InputManager input)
Creates a new inventory system. |
Method Summary | |
---|---|
void |
add(Item item)
Adds an item to the inventory. |
boolean |
contains(Item item)
Determines whether the inventory contains the specified item |
abstract void |
draw(javax.media.opengl.GL gl)
The method draws the inventory, when visible |
Color4f |
getBGColor()
Returns the background color of the inventory area. |
int |
getHeight()
Returns the height of the inventory area. |
java.util.LinkedList<Item> |
getItems()
Returns a list of the items in the inventory |
Item |
getItemUnderCursor()
Returns the item that lies beneath the mouse cursor. |
Item |
getSelectedInventoryItem()
Returns the currently selected inventory item. |
Color4f |
getTextColor()
Returns the text color of the inventory area. |
int |
getWidth()
Returns the width of the inventory area. |
int |
getX()
Returns the x coordinate of the inventory area. |
int |
getY()
Returns the y coordinate of the inventory area. |
boolean |
isMouseInInventory()
Helper method to figure out, if the mouse is located within the bounds of the inventory area. |
abstract boolean |
isMouseOverItem(Item item)
Determines whether or not the mouse is located over the specified inventory item. |
boolean |
isVisible()
Determines whether or not the inventory is currently visible. |
void |
remove(Item item)
Removes an item from the inventory. |
void |
setBGColor(Color4f color)
Sets the background color for the inventory area. |
void |
setHeight(int height)
Sets the height of the inventory area |
void |
setSelectedInventoryItem(Item item)
Sets the currently selected inventory item to the specified item. |
void |
setTextColor(Color4f color)
Sets the text color for the inventory area. |
void |
setVisible(boolean visible)
Sets the visibility status of the inventory. |
void |
setWidth(int width)
Sets the width of the inventory area |
void |
setX(int x)
Sets the x-coordinate of the inventory area. |
void |
setY(int y)
Sets the y-coordinate of the inventory area. |
void |
update(long elapsedTime)
This method updates the inventory. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractInventory(InputManager input)
input
- input manager objectMethod Detail |
---|
public int getHeight()
public void setHeight(int height)
height
- the height of the invemtory areapublic int getWidth()
public void setWidth(int width)
width
- the width of the inventory areapublic int getX()
public void setX(int x)
x
- x-coordinate of the inventory area.public int getY()
public void setY(int y)
y
- y-coordinate of the inventory areapublic void setVisible(boolean visible)
visible
- set visible? --> true=yes, false=nopublic boolean isVisible()
public boolean isMouseInInventory()
public abstract boolean isMouseOverItem(Item item)
item
- item in the inventory to check
public Item getItemUnderCursor()
public void setBGColor(Color4f color)
color
- background color for the inventorypublic Color4f getBGColor()
public void setTextColor(Color4f color)
color
- text color for the inventorypublic Color4f getTextColor()
public java.util.LinkedList<Item> getItems()
public void add(Item item)
item
- Item that shall be added to the inventorypublic void remove(Item item)
item
- item to remove from the inventorypublic Item getSelectedInventoryItem()
null
if none is selectedpublic boolean contains(Item item)
item
- item to check for existence in the inventory
public void setSelectedInventoryItem(Item item)
item
- item to set to the selected inventory itempublic void update(long elapsedTime)
elapsedTime
- time between two framespublic abstract void draw(javax.media.opengl.GL gl)
gl
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |