de.uni_paderborn.robots.robotArenaInterface
Class RobotData

java.lang.Object
  |
  +--de.uni_paderborn.robots.robotArenaInterface.RobotData

public final class RobotData
extends java.lang.Object


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
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

hand

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 !


energy

private int energy
energy of robot

robot

private FieldData robot

the field where the current robot stands


left

private FieldData left

field to the left of the robot


front

private FieldData front

field in front of the robot


right

private FieldData right

field to the right of the robot

Constructor Detail

RobotData

public RobotData(int energy,
                 FieldData robot,
                 FieldData left,
                 FieldData front,
                 FieldData right,
                 CardData[] cards)

Constructor to set all attributes in one step

Parameters:
energy - current robotenergy
robot - field on which is beyond of the robot
left - field left of the robot's view
front - field in front of the robot
right - field right of the robot's view
cards - array of cards the robot owns

RobotData

public RobotData()

constructor without data, creates empty RobotData

Method Detail

setRobot

public 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 !!!
Remember that this field must contain the VirtualRobot of the current robot.

Parameters:
robot - field beyond the robot

setLeft

public 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 !!!

Parameters:
left - field left of the robot's view

setFront

public 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 !!!

Parameters:
front - field in front of the robot

setRight

public 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 !!!

Parameters:
right - field right of the robot's view

setEnergy

public 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 !
If "getComand" is called the robot's energy has to be more than 0 !
=> method must be called !!!

Parameters:
energy - current energy of the robot

setHand

public void setHand(CardData[] cards)
             throws java.lang.IllegalArgumentException

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.

Parameters:
cards - set of cards the robot owns
Throws:
java.lang.IllegalArgumentException - is thrown if cards does not meet its definition

getEnergy

public final int getEnergy()

returns robots energy

Returns:
robots current energy

getHand

public final 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.
Returns:
array of cards the robot owns
See Also:
class CardData for further Information

getRobot

public final FieldData getRobot()

returns a FieldData reference of the field which robot stands on

Returns:
field beyond the robot

getLeft

public final FieldData getLeft()

returns a FieldData reference of field to the left of the robot

Returns:
field left of the robot's view

getFront

public final FieldData getFront()

returns a FieldData reference of field in front of the robot

Returns:
field in front of the robot

getRight

public final FieldData getRight()

returns a FieldData reference of field to the right of the robot

Returns:
field right of the robot's view