|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.planeth.gtroids.environment.FieldedArea
FieldedArea is an in quadrants splitted space to manage game objects
Quadrant,
QuadrantIterator| Constructor Summary | |
FieldedArea()
|
|
| Method Summary | |
void |
addPhysicalObject(AbstractPhysicalObject physicalObject)
Adds a AbstractPhysicalObject to the FieldedArea |
void |
deleteAllPhysicalObjects()
Removes all Objects from the FieldedArea |
Quadrant |
findQuadrant(int X,
int Y)
Returns the Quadrant for the passed coordinates |
java.util.Iterator |
getCollisionObjectIterator(AbstractPhysicalObject physicalObject)
Returns an Iterator with the objects of the following Quadrants: The Quadrant of the passed PhysicalObject (only the Objects after the passed PysicalObject included) The Quadrant at East The Quadrant at South-East The Quadrant at South This Iterator is used to get the Objects for Collision checks. |
java.util.Iterator |
getObjectIterator()
Returns an Iterator with the objects of all Quadrants |
java.util.Iterator |
getObjectSnapShotIterator()
Returns an Iterator with the objects of all Quadrants. |
Vector2D |
getQuadrantCoordsForPos(Vector2D pos)
Returns the quadrant coordinates for the passed position |
int |
getQuadrantCount()
Returns the number of quadrants in the area |
java.util.Iterator |
getRangedObjectIterator(AbstractPhysicalObject physicalObject,
int range)
Returns an Iterator with the objects of the Quadrants within a defined range from the viewpoint of the passed PhysicalObject. |
void |
initQuadrants(int width,
int height)
Initializes the Quadrants |
void |
paint(java.awt.Graphics g)
Paints the FieldedArea into the passed Graphics |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FieldedArea()
| Method Detail |
public int getQuadrantCount()
public void initQuadrants(int width,
int height)
public java.util.Iterator getObjectIterator()
public java.util.Iterator getObjectSnapShotIterator()
public java.util.Iterator getRangedObjectIterator(AbstractPhysicalObject physicalObject,
int range)
physicalObject - the PhysicalObject which defines the startPoint for the rangerange - the range of Quadrants from the viewPoint of the PhysicalObject
public java.util.Iterator getCollisionObjectIterator(AbstractPhysicalObject physicalObject)
physicalObject -
public void addPhysicalObject(AbstractPhysicalObject physicalObject)
physicalObject - the Object to be addedpublic Vector2D getQuadrantCoordsForPos(Vector2D pos)
pos - position to get the quadrant coordinates for
public void deleteAllPhysicalObjects()
public Quadrant findQuadrant(int X,
int Y)
X - x-coordinateY - y-coordinate
public void paint(java.awt.Graphics g)
g - the Graphics to paint into
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||