|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.maps.MapCell
This class implements a Cell using a linked list.
Constructor Summary | |
MapCell()
|
Method Summary | |
void |
add(GameObject obj)
Adds the specified object to the end of this cell. |
protected void |
addGroupable(GameObject item)
Adds a groupable item to the bag. |
boolean |
contains(GameObject obj)
Tests to see if the specified object is a object in this cell. |
java.util.List |
getItems()
|
java.util.List |
getItemsNonNull()
|
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. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public MapCell()
Method Detail |
public void add(GameObject obj)
Cell
add
in interface Cell
obj
- the object to be addedpublic boolean contains(GameObject obj)
Cell
contains
in interface Cell
obj
- the object to search for
public GameObject objectAt(int index)
Cell
objectAt
in interface Cell
public java.util.Iterator iterator()
Cell
iterator
in interface Cell
public java.util.List objects()
Cell
objects
in interface Cell
public boolean isEmpty()
Cell
isEmpty
in interface Cell
public void insert(int index, GameObject obj)
Cell
insert
in interface Cell
public void removeAll()
Cell
removeAll
in interface Cell
public GameObject remove(int index)
Cell
remove
in interface Cell
public boolean remove(GameObject obj)
Cell
remove
in interface Cell
obj
- the object to remove. Does nothing if the obj isn't
in the cell already.
public GameObject setObjectAt(int index, GameObject obj)
Cell
setObjectAt
in interface Cell
index
- the index to insert atobj
- the object to insert
public int size()
Cell
size
in interface Cell
public java.lang.String toString()
protected void addGroupable(GameObject item)
item
- the groupable item. Someone must have already
ascertained that the item has the "groupable" property, since
we don't check here.public java.util.List getItemsNonNull()
public java.util.List getItems()
public void setTerrain(Terrain t)
Cell
setTerrain
in interface Cell
public Terrain getTerrain()
Cell
getTerrain
in interface Cell
public PropertyList getProperties()
Cell
getProperties
in interface Cell
public PropertyList getPropertyList()
Cell
getPropertyList
in interface Cell
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |