|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--de.uni_paderborn.robots.robotArenaInterface.RobotData
This container class is the only parameter for getCommand
and contains sight of the robot ( in robot, left, front, right ),
the cards on the hand of the robot ( hand ) and the current
energy of the robot.
All this information is provided by an arena and used to
plan / calculate the next action of a robot.
| Field Summary | |
private int |
energy
energy of robot |
private FieldData |
front
field in front of the robot |
private CardData[] |
hand
cards on the hand of the robot If the robot owns no cards "hand" is null. Otherwise the length of the array is between 1 and 5 and no element of the array is null ! |
private FieldData |
left
field to the left of the robot |
private FieldData |
right
field to the right of the robot |
private FieldData |
robot
the field where the current robot stands |
| Constructor Summary | |
RobotData()
constructor without data, creates empty RobotData |
|
RobotData(int energy,
FieldData robot,
FieldData left,
FieldData front,
FieldData right,
CardData[] cards)
Constructor to set all attributes in one step |
|
| Method Summary | |
int |
getEnergy()
returns robots energy |
FieldData |
getFront()
returns a FieldData reference of field in front of the robot |
CardData[] |
getHand()
returns the current hand of the robot The return value can be null or a reference to an array with 1 to 5 elements, containing no array elements equal to null. |
FieldData |
getLeft()
returns a FieldData reference of field to the left of the robot |
FieldData |
getRight()
returns a FieldData reference of field to the right of the robot |
FieldData |
getRobot()
returns a FieldData reference of the field which robot stands on |
void |
setEnergy(int energy)
used to set the Energy of the robot If energy is 0 the robot's "getCommand" is not called and this Object is not needed ! |
void |
setFront(FieldData front)
used to set the FieldData reference of the field in front of the robot FieldData reference is not allowed to be null. => method must be called !!! |
void |
setHand(CardData[] cards)
used to give the robot his current hand of cards The parameter "cards" can be null or a reference to an array with 1 to 5 elements which contains no array elements equal to null. |
void |
setLeft(FieldData left)
used to sets the FieldData reference of the field to the left of the robot FieldData reference is not allowed to be null. => method must be called !!! |
void |
setRight(FieldData right)
used to set the FieldData reference of the field to the right of the robot FieldData reference is not allowed to be null. => method must be called !!! |
void |
setRobot(FieldData robot)
used to set the FieldData reference of the field where the robot stands FieldData reference is not allowed to be null. => method must be called !!! |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private CardData[] hand
private int energy
private FieldData robot
private FieldData left
private FieldData front
private FieldData right
| Constructor Detail |
public RobotData(int energy,
FieldData robot,
FieldData left,
FieldData front,
FieldData right,
CardData[] cards)
energy - current robotenergyrobot - field on which is beyond of the robotleft - field left of the robot's viewfront - field in front of the robotright - field right of the robot's viewcards - array of cards the robot ownspublic RobotData()
| Method Detail |
public void setRobot(FieldData robot)
robot - field beyond the robotpublic void setLeft(FieldData left)
left - field left of the robot's viewpublic void setFront(FieldData front)
front - field in front of the robotpublic void setRight(FieldData right)
right - field right of the robot's viewpublic void setEnergy(int energy)
energy - current energy of the robot
public void setHand(CardData[] cards)
throws java.lang.IllegalArgumentException
cards - set of cards the robot ownsjava.lang.IllegalArgumentException - is thrown if cards does not meet its definitionpublic final int getEnergy()
public final CardData[] getHand()
class CardData for further Informationpublic final FieldData getRobot()
public final FieldData getLeft()
public final FieldData getFront()
public final FieldData getRight()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||