|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--simworldobjects.BasicSimWorld
Abstract class for SimWorlds, provides a base implementation of the SimWorld interface which more complex worlds can extend. (e.g by adding lights, walls etc.)
SimWorld
Constructor Summary | |
BasicSimWorld(long x,
long y,
long z)
Sets up the basic sim world |
Method Summary | |
void |
addObject(SimObject s)
Adds an object to this SimWorld |
boolean |
colliding(SimObject o,
SimObject p)
Checks if SimObject o is colliding with SimObject p. |
int |
getBrightness(double x,
double y,
double z)
Returns the light level at the specified co-ordinate. |
java.util.LinkedList |
getObjectList()
Returns this SimWorld's object list |
long |
getTime()
Returns the number of 'ticks' since this world was started |
boolean |
hasObstacle(double x,
double y,
double z)
Checks whether there is an obstacle in the specified co-ordinate |
void |
tick()
Performs one update loop |
void |
updateObjects()
Updates all the SimObjects in this world by one step |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BasicSimWorld(long x, long y, long z)
x
- the largest x cooridnate in this worldy
- the largest y cooridnate in this worldz
- the largest z cooridnate in this worldMethod Detail |
public void tick()
tick
in interface SimWorld
public long getTime()
getTime
in interface SimWorld
public int getBrightness(double x, double y, double z)
getBrightness
in interface SimWorld
public boolean hasObstacle(double x, double y, double z)
hasObstacle
in interface SimWorld
x
- the x coordinatey
- the y coordinatez
- the z coordinatepublic boolean colliding(SimObject o, SimObject p)
o
- the first SimObjectp
- the second SimObjectpublic void addObject(SimObject s)
addObject
in interface SimWorld
o
- the SimObject to be addedpublic java.util.LinkedList getObjectList()
getObjectList
in interface SimWorld
public void updateObjects()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |