|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimworldobjects.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 |
|
BasicSimWorld(long x,
long y,
long z,
java.awt.Color c)
Sets up the basic sim world Created by: Simon Zienkiewicz |
Method Summary | |
void |
addObject(SimObject s)
Adds an object to the back of this SimWorld |
void |
addObjecttoFront(SimObject s)
Adds an object to the front of any Robot object/part in the list Added by: Simon Zienkiewicz |
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.awt.Color |
getColorUnderLightSensor(SimLightSensor lightSensor)
Gets the color under the position of the light sensor |
java.util.LinkedList |
getObjectList()
Returns this SimWorld's object list |
long |
getTime()
Returns the number of 'ticks' since this world was started |
java.awt.Color |
getWorldColor()
Gets the ground color of the world Created by: Simon Zienkiewicz |
int[] |
getWorldDimensions()
Gets the dimensions of the world Created by: Simon Zienkiewicz |
boolean |
hasObstacle(double x,
double y,
double z)
Checks whether there is an obstacle in the specified co-ordinate |
void |
setWorldColor(java.awt.Color color)
Sets the ground color of the world Created by: Simon Zienkiewicz |
void |
tick()
Performs one update loop |
void |
updateObjectList(java.util.LinkedList newList)
|
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 worldpublic BasicSimWorld(long x, long y, long z, java.awt.Color c)
x
- the largest x cooridnate in this worldy
- the largest y cooridnate in this worldz
- the largest z cooridnate in this worldc
- the Color of the ground of the 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
x
- the x coordinate of position searchedy
- the y coordinate of position searchedz
- the z coordinate of position searched
public boolean hasObstacle(double x, double y, double z)
hasObstacle
in interface SimWorld
x
- the x coordinatey
- the y coordinatez
- the z coordinate
public boolean colliding(SimObject o, SimObject p)
o
- the first SimObjectp
- the second SimObject
public void addObject(SimObject s)
addObject
in interface SimWorld
s
- the SimObject to be addedpublic void addObjecttoFront(SimObject s)
public java.util.LinkedList getObjectList()
getObjectList
in interface SimWorld
public void updateObjects()
public java.awt.Color getColorUnderLightSensor(SimLightSensor lightSensor)
lightSensor
- the light sensor objectpublic java.awt.Color getWorldColor()
getWorldColor
in interface SimWorld
public void setWorldColor(java.awt.Color color)
public int[] getWorldDimensions()
public void updateObjectList(java.util.LinkedList newList)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |