|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the interface to the "buckets" used for storing objects at map locations. Regardless of the type of bucket used, the interface is the same. Clients of the map never manipulate Cell implementations directly.
Method Summary | |
void |
add(GameObject obj)
Adds the specified object to the end of this cell. |
boolean |
contains(GameObject obj)
Tests to see if the specified object is a object in this cell. |
PropertyList |
getProperties()
Returns the PropertyList for this cell. |
PropertyList |
getPropertyList()
Creates a PropertyList for this Cell, if necessary, and returns it. |
Terrain |
getTerrain()
Returns the Terrain set for this cell, if it has one. |
void |
insert(int index,
GameObject obj)
Inserts the specified object into this cell at the specified index. |
boolean |
isEmpty()
Tests if this cell has no objects. |
java.util.Iterator |
iterator()
Returns an Iterator over the objects in the cell. |
GameObject |
objectAt(int index)
Returns the object at the specified index. |
java.util.List |
objects()
Returns a List of the objects in the Cell. |
boolean |
remove(GameObject obj)
Removes the specified object from the cell. |
GameObject |
remove(int index)
Deletes the object at the specified index. |
void |
removeAll()
Removes all objects from this cell. |
GameObject |
setObjectAt(int index,
GameObject obj)
Replaces the object at the specified index. |
void |
setTerrain(Terrain t)
Sets the Terrain for this cell. |
int |
size()
Returns the number of objects in this cell. |
Method Detail |
public void add(GameObject obj)
obj
- the object to be addedpublic boolean contains(GameObject obj)
obj
- the object to search for
public GameObject objectAt(int index)
public java.util.List objects()
public java.util.Iterator iterator()
public boolean isEmpty()
public void insert(int index, GameObject obj)
public void removeAll()
public GameObject remove(int index)
public boolean remove(GameObject obj)
obj
- the object to remove. Does nothing if the obj isn't
in the cell already.
public GameObject setObjectAt(int index, GameObject obj)
index
- the index to insert atobj
- the object to insert
java.lang.IndexOutOfBoundsException
- if specified index is out
of range (i.e. index < 0 || index >= size());public int size()
public void setTerrain(Terrain t)
public Terrain getTerrain()
public PropertyList getProperties()
public PropertyList getPropertyList()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |