de.uni_paderborn.robots.robot.group10
Class CardStrategy

java.lang.Object
  |
  +--de.uni_paderborn.robots.robot.group10.AbstractStrategy
        |
        +--de.uni_paderborn.robots.robot.group10.CardStrategy

public class CardStrategy
extends AbstractStrategy

one of the different strategy classes the robot tries to take the a way back to a previous card


Field Summary
private  CardData cardToDrop
          The card to be dropped
private static int LEFT
          State for getBestCardToGet(): best card (left or right) is left
private static int NONE
          State for getBestCardToGet(): none of the cards lead to more points
private static int RIGHT
          State for getBestCardToGet(): best card (left or right) is right
 
Fields inherited from class de.uni_paderborn.robots.robot.group10.AbstractStrategy
cardDroppedDirection, currentRobot, EXCHANGED_CARD, IDLE, lastAction, map, MOVED_AWAY, PICKED_CARD, PICKED_OLD_CARD_AGAIN, pickedCard, random, shortestPath, TURNED_BACK_TO_OLD
 
Constructor Summary
CardStrategy(CardFinder robot)
          constructor method
 
Method Summary
 int getBestCardToGet()
          Function which returns the direction of the best card
 AbstractRobotAction getCommand()
          the getCommand method
 int getValueWithNewCard(CardData newCard)
          This method return the value which the robot has with a new card
 
Methods inherited from class de.uni_paderborn.robots.robot.group10.AbstractStrategy
dropCard, findFreeField, getCurrentRobot, getMap, setCurrentRobot, setMap
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

cardToDrop

private CardData cardToDrop
The card to be dropped

NONE

private static final int NONE
State for getBestCardToGet(): none of the cards lead to more points

LEFT

private static final int LEFT
State for getBestCardToGet(): best card (left or right) is left

RIGHT

private static final int RIGHT
State for getBestCardToGet(): best card (left or right) is right
Constructor Detail

CardStrategy

public CardStrategy(CardFinder robot)
constructor method
Parameters:
robot - a reference to the CardFinder that uses the strategy
Method Detail

getCommand

public AbstractRobotAction getCommand()
the getCommand method
Overrides:
getCommand in class AbstractStrategy
Returns:
null

getBestCardToGet

public int getBestCardToGet()
Function which returns the direction of the best card
Returns:
direction to the best valuated card

getValueWithNewCard

public final int getValueWithNewCard(CardData newCard)
This method return the value which the robot has with a new card
Parameters:
newCard - the card to evaluate with the current cardset.
Returns:
best value with the new card