public final class Inventory
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Method and Description |
---|---|
void |
addEntity(Entity e)
Adds an entity to the inventory.
|
Entity |
getEntity(int i)
Warning: no existence check is done.
|
int |
getEntityCount() |
Entity |
getSelectedEntity() |
boolean |
isCurrentlyDisplayed() |
boolean |
isEmpty() |
void |
removeEntity(Entity e)
Removes an entity from a player's inventory.
|
void |
setGui(InventoryZone gui) |
void |
updateList(javax.swing.JList<Entity> list,
EntityListModel model) |
void |
updateView()
Updates the inventory display.
|
public Inventory(Player p)
public void addEntity(Entity e)
e
- Entity to be added.public void removeEntity(Entity e)
e
- The entity to be removed from the inventory.public void setGui(InventoryZone gui)
public boolean isCurrentlyDisplayed()
public Entity getSelectedEntity()
public void updateView()
public boolean isEmpty()
public int getEntityCount()
public Entity getEntity(int i)
i
- Index of the entity to be returned.public void updateList(javax.swing.JList<Entity> list, EntityListModel model)