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 proived by an arena and used to plan / calculate the next action of a robot.


Constructor Summary
RobotData()
          constructor without data
RobotData(int energy, FieldData robot, FieldData left, FieldData front, FieldData right, CardData[] cards)
          Does somebody want this constructor !?!?
 
Method Summary
 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.
 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 param)
          used to sets the FieldData reference of the field to the left of the robot FieldData reference is not allowed to be null.
 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.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RobotData

public RobotData(int energy,
                 FieldData robot,
                 FieldData left,
                 FieldData front,
                 FieldData right,
                 CardData[] cards)
Does somebody want this constructor !?!? Please inform joda@upb.de.

RobotData

public RobotData()
constructor without data
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.

setLeft

public void setLeft(FieldData param)
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 !!!

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

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

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

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. If "cards" does not meet this definition an IlleagalArgumentException is thrown.

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.

getRobot

public final FieldData getRobot()
returns a FieldData reference of the field which robot stands on

getLeft

public final FieldData getLeft()
returns a FieldData reference of field to the left of the robot

getFront

public final FieldData getFront()
returns a FieldData reference of field in front of the robot

getRight

public final FieldData getRight()
returns a FieldData reference of field to the right of the robot