|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--de.uni_paderborn.robots.robot.group10.AbstractStrategy
AbstractStrategy
| Field Summary | |
private static int |
cardDroppedDirection
Stores the direction the robot's card was dropped by dropCard() |
(package private) CardFinder |
currentRobot
attribute currentRobot for easy access |
private static int |
EXCHANGED_CARD
State for dropCard(): The robot has exchanged the card |
private static int |
IDLE
State for dropCard(): There is currently no card dropping process |
private static int |
lastAction
Stores the state dropCard() is in. |
(package private) Map |
map
The map this strategy uses. |
private static int |
MOVED_AWAY
State for dropCard(): The robot has moved the card away that blocked the way |
private static int |
PICKED_CARD
State for dropCard(): The robot has picked up the card |
private static int |
PICKED_OLD_CARD_AGAIN
State for dropCard(): The robot picked again the card he dropped |
private static CardData |
pickedCard
Stores the card the robot picked up |
protected java.util.Random |
random
random number generator |
private Map.ShortestPath |
shortestPath
This field stores the shortestPath this strategy uses between the game rounds |
private static int |
TURNED_BACK_TO_OLD
State for dropCard(): The robot turned back to the card he dropped in the beginning |
| Constructor Summary | |
AbstractStrategy(CardFinder robot)
constructor method |
|
| Method Summary | |
AbstractRobotAction |
dropCard(CardData cardToDrop,
boolean moveCardAway)
This method generates AbstractActions in order to pickup a card that lies in front of the robot when the robot's portable is already full. |
private AbstractRobotAction |
findFreeField()
Tries to create a RotateAction in order to rotate to an possibly empty field. |
abstract AbstractRobotAction |
getCommand()
get command for next action (abtract) |
CardFinder |
getCurrentRobot()
read access for currentRobot |
Map |
getMap()
read access for the map |
void |
setCurrentRobot(CardFinder value)
write access for cf |
void |
setMap(Map value)
write access for the map |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected java.util.Random random
Map map
CardFinder currentRobot
private static final int IDLE
private static final int EXCHANGED_CARD
private static final int PICKED_CARD
private static final int MOVED_AWAY
private static final int TURNED_BACK_TO_OLD
private static final int PICKED_OLD_CARD_AGAIN
private static int lastAction
private static int cardDroppedDirection
private static CardData pickedCard
private Map.ShortestPath shortestPath
| Constructor Detail |
public AbstractStrategy(CardFinder robot)
robot - a reference to the CardFinder that uses the strategy| Method Detail |
public CardFinder getCurrentRobot()
public void setCurrentRobot(CardFinder value)
value - reference to the current CardFinderpublic Map getMap()
public void setMap(Map value)
value - the current Mappublic abstract AbstractRobotAction getCommand()
private AbstractRobotAction findFreeField()
public AbstractRobotAction dropCard(CardData cardToDrop,
boolean moveCardAway)
cardToDrop - a card from the robot's portable that is droppedmaveCardAway - is true if a card needs to be moved away
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||