|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgroup1.model.EnvironmentGridSpace
public class EnvironmentGridSpace
A space on the Environment grid. This contains a list of GameObj's at that location on the grid. This is not used to store the data directly. Rather, this is used to speed up computations, with the small overhead that the Environment class must keep the grid's object lists accurate.
| Constructor Summary | |
|---|---|
EnvironmentGridSpace()
Default constructor. |
|
EnvironmentGridSpace(double x,
double y,
double side_length)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addObject(GameObj object)
Add an object to this grid space. |
int |
getNumObjects()
Get the number of objects in this grid space. |
GameObj |
getObject(int i)
Get the i'th object in this grid space. |
java.util.List<GameObj> |
getObjects()
Get the list of objects in this grid space. |
XYPair |
getPosition()
Get the position of this grid space. |
java.awt.geom.Rectangle2D |
getSquare()
Directly get the rectangle representing this grid space. |
void |
removeObject(GameObj object)
Remove an object from this grid space. |
void |
removeObject(int i)
Remove the i'th object from this grid space. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EnvironmentGridSpace()
public EnvironmentGridSpace(double x,
double y,
double side_length)
x - The x-position.y - The y-position.side_length - The length of a side of the grid space square.| Method Detail |
|---|
public java.util.List<GameObj> getObjects()
public GameObj getObject(int i)
i - The index of the object.
public int getNumObjects()
public void addObject(GameObj object)
object - The object to be added.public void removeObject(GameObj object)
object - The object to be removed.public void removeObject(int i)
i - The index of the object to be removed.public XYPair getPosition()
public java.awt.geom.Rectangle2D getSquare()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||