|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--de.uni_paderborn.robots.items.Item
|
+--de.uni_paderborn.robots.logic.Robot
the class for the robot especially all its features
| Field Summary | |
private Arena |
arena
the arena of the robot only one arena for the robot possible! |
private int |
direction
direction of the robot |
private boolean |
disqualified
|
static int |
EAST
direction: EAST : Integer = 4 |
private int |
energy
energy of the robot |
static int |
NORTH
direction: NORTH : Integer = 1 |
private java.util.HashSet |
portable
HashSet of the cards note: every robot may only have five cards! |
private ArenaImages.RobotImages |
robotImages
Imageset of this robot to be used by the GUI. |
private RobotTimer |
robotTimer
The RobotTimer that controls the needed time of this robot. |
static int |
SOUTH
direction: SOUTH : Integer = 3 |
static int |
WEST
direction: WEST : Integer = 2 |
| Fields inherited from class de.uni_paderborn.robots.items.Item |
field, name |
| Constructor Summary | |
Robot()
|
|
| Method Summary | |
void |
addToPortable(Card elem)
adds a new card to the hashSet also creates a new hashSet when first card is added |
boolean |
exchangeOK(Card myCard,
Card otherCard)
checks whether both robots want to exchange should be implemented seriously in the special robot classes |
Card |
exchangeProposal()
for card exchange should be implemented seriously in the special robot classes |
Arena |
getArena()
access to the arena |
AbstractAction |
getCommand()
getCommand of the robot should be implemented seriously in the special robot classes |
int |
getDirection()
Read access method for attribute direction |
int |
getEnergy()
Read access method for attribute energy |
ArenaImages.RobotImages |
getImages()
Returns the image set of this robot |
RobotTimer |
getRobotTimer()
access to the robotTimer |
boolean |
hasInPortable(Card elem)
checks the hashSet of cards if there is this card in yet |
boolean |
isDisqualified()
|
java.util.Iterator |
iteratorOfPortable()
access to the iteratorOfPortabel also creates a new one if necessary |
void |
removeAllFromPortable()
removes all cards in portable |
void |
removeFromPortable(Card elem)
removes a Card out of the iterator |
void |
removeYou()
removes robot from the arena |
void |
setArena(Arena elem)
to set the arena |
int |
setDirection(int direction)
Write access method for attribute direction |
void |
setDisqualified(boolean d)
|
int |
setEnergy(int energy)
Write access method for attribute energy checks the energy not to be below 0 and above max energy |
void |
setImages(ArenaImages.RobotImages robotImages)
Sets the image set of this robot |
int |
sizeOfPortable()
access to the number of cards in portable |
| Methods inherited from class de.uni_paderborn.robots.items.Item |
getField, getIcon, getName, setField, setName |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private int energy
private int direction
public static final int NORTH
public static final int WEST
public static final int EAST
public static final int SOUTH
private RobotTimer robotTimer
private boolean disqualified
private java.util.HashSet portable
private Arena arena
private ArenaImages.RobotImages robotImages
| Constructor Detail |
public Robot()
| Method Detail |
public AbstractAction getCommand()
public Card exchangeProposal()
public final int getDirection()
public final int setDirection(int direction)
direction - the direction the robot should look topublic final int getEnergy()
energy - the current energy of the robotpublic final int setEnergy(int energy)
energy - the energy the robot shall havepublic void setDisqualified(boolean d)
public boolean isDisqualified()
public boolean exchangeOK(Card myCard,
Card otherCard)
myCard - the proposed card of the robototherCard - the proposal card of the other robotwhether - ok to cahnge or notpublic final void addToPortable(Card elem)
elem - the card which wants to be addedpublic final boolean hasInPortable(Card elem)
elem - the Card to checkpublic final java.util.Iterator iteratorOfPortable()
public final void removeFromPortable(Card elem)
elem - the Card which shall be removedpublic final int sizeOfPortable()
public final void removeAllFromPortable()
public final void removeYou()
removeYou in class Itempublic final void setArena(Arena elem)
elem - the arenapublic final Arena getArena()
public final void setImages(ArenaImages.RobotImages robotImages)
robotImages - Image set to be used for this robotpublic final ArenaImages.RobotImages getImages()
public RobotTimer getRobotTimer()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||