|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jzuul.engine.Inventory
Das Inventar eines Spielers oder eines Raums. Hier werden die aufgenommen GameObjects gehalten. Das Inventar hat eine Grösse. Jedes aufgenomme GameObject belegt Platz im Inventar, so dass nur eine gewisse Anzahl an GameObjects aufgenommen werden kann.
| Field Summary | |
(package private) int |
fillStat
Füllstatus des Inventars |
protected Map |
gameObjectMap
Interner Datentyp zum halten der GameObjects HashMap of Stacks |
(package private) boolean |
isUnlimited
Bildet size == UNLIMITED_INVENTORY ab |
(package private) int |
size
Größe des Inventars in Einheiten |
static int |
UNLIMITED_INVENTORY
Größenwert für ein unendlich großes Inventar |
| Constructor Summary | |
Inventory(int size)
Konstruktor |
|
| Method Summary | |
boolean |
addGameObject(GameObject item)
Fügt ein neues Item in das Inventar ein |
boolean |
contains(List objects)
|
boolean |
contains(String[] objects)
Fragt nach ob das Inventar die GameObjects mit den gegebenen Namen enthält |
boolean |
containsGameObject(String name)
Fragt ob das Iventory das GameObject mit dem Namen name enthält |
Inventory |
copy()
Erstellt eine depp copy des aktuellen Inventars |
boolean |
deleteGameObject(String name)
Löscht das Item mit dem Namen name |
Iterator |
gameObjectNamesIterator()
Liefert Iterator über die Namen der Objekt in dem Inventars |
List |
getCharacterObjects()
Sucht alle Character im Inventar |
GameObject |
getGameObject(String name)
Get a GameObject by name |
Iterator |
getGameObjects()
Gibt alle GameObjects im Inventar zurück |
int |
getNumberOfObject(String name)
Fragt nach der Anzahl der Objekte mit dem gegebenen Namen |
GameObject |
popGameObject(String name)
popItem gibt das GameObject mit dem Namen name zurück und entfernt dieses aus dem Inventar |
boolean |
pushGameObject(GameObject item)
|
Element |
toElement()
Wandelt das Inventar in ein JDOM XML Element um. |
String |
toString()
Gibt eine textuelle Beschreibung des Inventars zurück |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected Map gameObjectMap
int size
int fillStat
boolean isUnlimited
public static int UNLIMITED_INVENTORY
| Constructor Detail |
public Inventory(int size)
size - - Die größe des Inventar| Method Detail |
public boolean addGameObject(GameObject item)
item - das Aufgenommen werden soll
public boolean pushGameObject(GameObject item)
item - das Item das hinzugefügt werden soll
addGameObject(org.jzuul.engine.GameObject)public GameObject getGameObject(String name)
name - Name des GameObjects das geholt werden soll
public Iterator gameObjectNamesIterator()
public boolean containsGameObject(String name)
name - der Name des GameObject
public boolean deleteGameObject(String name)
name - der Name des zu löschenden Objektes
public GameObject popGameObject(String name)
name -
public String toString()
public List getCharacterObjects()
public Iterator getGameObjects()
public Element toElement()
public boolean contains(String[] objects)
objects - Die Namen der zu überprüfenden GameObjects
public int getNumberOfObject(String name)
name - ein Name eines GameObjects
public boolean contains(List objects)
objects - eine Liste von Objekten die überprüft werden sollen
contains(String[] objects)public Inventory copy()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||