de.uni_paderborn.robots.robotArenaInterface
Interface RobotFunctions

All Known Implementing Classes:
CardFinder, Waiter, NullPutter, Exok12s, AlwaysPickUp, WrongCardPutter, WrongCardExchanger, Stupid, NullExchanger, LessStupid, TooManyPickUp, Robot, WrongFieldExchanger, WrongCardReturner, Exok_ExProp12s, WrongFieldPutter, LazyRobot, AvoidExitLessStupid, Move12s, AlwaysMover, TooLateProposal, Proxy

public interface RobotFunctions


This interface must be implemented
in the robot class of each group
in order to provide a unified interface
to the arena.


Method Summary
 boolean exchangeOk(CardData myCard, CardData otherCard)
          
ask robot if it wants to exchange
it's own card ( "myCard" ) with
the card of another robot ( "otherCard" )

 CardData exchangeProposal(CardData[] cards)
          
ask the robot for a card he wants to exchange
If the robot does not own the returned
card the robot is disqualified.

parameter "cards" :
actual hand of robot

return values :
null - robot does not want to exchange
Reference to CardData Object - robot wants to offer this card
 AbstractRobotAction getCommand(RobotData robotData)
          
ask robot for next command
If the return value is null the arena
disqualifies the robot.

 

Method Detail

getCommand

public AbstractRobotAction getCommand(RobotData robotData)

ask robot for next command
If the return value is null the arena
disqualifies the robot.

Parameters:
robotData - current status of the robot
Returns:
a subclass of AbstractRobotAction which contains the robot's next command

exchangeProposal

public CardData exchangeProposal(CardData[] cards)

ask the robot for a card he wants to exchange
If the robot does not own the returned
card the robot is disqualified.

parameter "cards" :
actual hand of robot

return values :
  • null - robot does not want to exchange
  • Reference to CardData Object - robot wants to offer this card

  • Parameters:
    cards - set of cards the robot owns
    Returns:
    a card a robot is willing to change

    exchangeOk

    public boolean exchangeOk(CardData myCard,
                              CardData otherCard)

    ask robot if it wants to exchange
    it's own card ( "myCard" ) with
    the card of another robot ( "otherCard" )

    Parameters:
    myCard - card the robot wants to give away
    otherCard - card the robot wants to have
    Returns:
    true if the robot is willing to change