|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--de.uni_paderborn.robots.data.Item
|
+--de.uni_paderborn.robots.data.Robot
A robot in the arena.
| Field Summary | |
private java.util.HashSet |
cards
cards of the robot |
private int |
direction
direction of robot, 0 if looking in south direction, larger numbers are reached by turning right |
private boolean |
disqualified
true, if robot is disqualified |
private int |
energy
energy of the robot |
static int |
FORWARD
FORWARD direction (do not change the value!) |
private boolean |
hasExitEntered
true if robot has entered the Exit |
private RobotFunctions |
intelligence
brain of robot, interface to thread class with implemented strategy |
static int |
LEFT
LEFT direction (do not change the value!) |
private static int |
maxEnergy
maximum of energy a robot can have |
private java.lang.String |
name
the name of the robot |
private RobotFunctions |
proxy
proxy which procotols communication between arena and robot |
static int |
RIGHT
RIGHT direction (do not change the value!) |
static long |
serialVersionUID
used for serialization |
private int |
type
type of robot, used for identifying robots by the game and gui classes |
| Fields inherited from class de.uni_paderborn.robots.data.Item |
field, id |
| Constructor Summary | |
Robot(RobotFunctions proxy,
RobotFunctions intelligence,
java.lang.String name,
int type,
int direction,
int energy)
constructor, creates a robot with the specified brain, direction and energy. |
|
| Method Summary | |
boolean |
addCard(Card card)
Add a card to robots portable. |
boolean |
changeEnergy(int delta)
Changes the robots energy by adding delta. |
void |
disqualify()
Disqualifies robot. |
boolean |
equals(Robot robot)
Tests if an object is equal to this one. |
java.util.HashSet |
getCards()
Returns a hashset of the card in the robots portable. |
int |
getDirection()
Returns direction of robot. |
int |
getEnergy()
Returns the energy of the robot. |
boolean |
getExitEnteredFlag()
Returns true if robot has entered the exit |
Field |
getFieldInDirection(int bearing)
Returns field in direction |
RobotFunctions |
getIntelligence()
Returns the RobotFunctions interface of this robot. |
static int |
getMaxEnergy()
Returns the maximum energy a robot can have. |
java.lang.String |
getName()
Returns the name of the robot; the name is equal to the class name. |
int |
getPoints()
Returns the points of this robot. |
RobotFunctions |
getProxy()
Returns the proxy interface for this robot. |
int |
getType()
Returns the type of the robot. |
boolean |
isDisqualified()
Determines if robot is disqualified. |
boolean |
isSleeping()
Determines if robot is sleeping that means its energy is equal to 0. |
int |
numberOfCards()
Returns the number of cards owned by the robot. |
boolean |
removeCard(Card card)
Removes a card from a robots portable |
void |
setDirection(int direction)
Sets direction of robot. |
boolean |
setEnergy(int energy)
Sets energy of the robot. |
void |
setExitEnteredFlag()
Sets hasExitEntered to true |
static boolean |
setMaxEnergy(int newMaxEnergy)
Sets the maximum of energy a robot can have. |
void |
setType(int type)
Sets the type of the robot. |
| Methods inherited from class de.uni_paderborn.robots.data.Item |
finalize, getField, getID, getItemName, setField |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final long serialVersionUID
public static final int LEFT
public static final int FORWARD
public static final int RIGHT
private int type
private boolean disqualified
private boolean hasExitEntered
private int direction
private int energy
private static int maxEnergy
private java.util.HashSet cards
private RobotFunctions intelligence
private RobotFunctions proxy
private java.lang.String name
| Constructor Detail |
public Robot(RobotFunctions proxy,
RobotFunctions intelligence,
java.lang.String name,
int type,
int direction,
int energy)
proxy - proxy which protocols communication between arena and robotintelligence - interface to robot thread class with implemented strategyname - the name for the robottype - type of robot, used for identifying robots by the game and gui classesdirection - direction of robotenergy - initial energy of robot| Method Detail |
public int getDirection()
public void setDirection(int direction)
direction - new direction of robotpublic static boolean setMaxEnergy(int newMaxEnergy)
newMaxEnergy - new maximum energy of robotspublic static int getMaxEnergy()
public boolean addCard(Card card)
card - card to add to the robots portablepublic boolean removeCard(Card card)
card - card to remove from the robots portablepublic java.util.HashSet getCards()
public int numberOfCards()
public int getEnergy()
public boolean setEnergy(int energy)
energy - of robotpublic boolean changeEnergy(int delta)
delta - add to the robots current energy.public boolean isSleeping()
public boolean isDisqualified()
public void disqualify()
public void setType(int type)
type - of robotpublic int getType()
public RobotFunctions getIntelligence()
public RobotFunctions getProxy()
public java.lang.String getName()
public boolean equals(Robot robot)
public int getPoints()
public Field getFieldInDirection(int bearing)
public void setExitEnteredFlag()
public boolean getExitEnteredFlag()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||