|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--world.Robot
Class that implements robots for the ICFP-2002 programming contest entry.
Constructor Summary | |
protected |
Robot(World world,
int id,
int capacity)
Creates a robot. |
Method Summary | |
int |
compareTo(Object object)
Compares this object with the specified object for order. |
void |
drop(int id)
Method to drop a package. |
int |
getCapacity()
Method to get the robot's capacity. |
int |
getId()
Method to get the robot ID. |
int |
getLoad()
Method to get the robot's current load. |
Sack |
getSack()
Method to get the tile's sack. |
int |
getScore()
Method to get the robot score. |
Tile |
getTile()
Method to get the robot's [location] tile. |
Tile[] |
getTrail()
|
List |
getTrailList()
|
World |
getWorld()
Method to get the robot's world of residence. |
boolean |
isVulnerable()
Method to determine if the robot is vulnerable. |
void |
moveEast()
Method to move the robot East. |
void |
moveNorth()
Method to move the robot North. |
void |
moveSouth()
Method to move the robot South. |
void |
moveWest()
Method to move the robot West. |
void |
pick(int id)
Method to pick[-up] a package. |
protected void |
setCapacity(int capacity)
Method to set the robot's capacity. |
void |
setScore(int score)
Method to set the robot score. |
void |
setTile(Tile tile)
Method to set the robot's [location] tile. |
String |
toString()
Method to get a string description of the robot. |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
protected Robot(World world, int id, int capacity)
world
- The world this robot resides in.id
- The robot ID.capacity
- The robot's capacity.Method Detail |
public World getWorld()
public int getId()
getId
in interface ID
public int getCapacity()
protected void setCapacity(int capacity)
capacity
- The robot's capacity.public int getLoad()
public int getScore()
public void setScore(int score)
score
- The robot score.public Sack getSack()
public Tile getTile()
getTile
in interface Locality
public void setTile(Tile tile)
public void moveNorth()
public void moveSouth()
public void moveEast()
public void moveWest()
public List getTrailList()
public Tile[] getTrail()
public void drop(int id)
id
- The package ID of the package to be dropped.public void pick(int id)
id
- The package ID of the package to be picked.public boolean isVulnerable()
public String toString()
toString
in class Object
public int compareTo(Object object)
compareTo
in interface Comparable
object
- The object to be compared.Comparable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |