core
Class Player

java.lang.Object
  extended by core.Player
All Implemented Interfaces:
net.antichess.ai.AiPlayer
Direct Known Subclasses:
HumanPlayer, OptimizingAlphaBetaPlayer, RandomPlayer

public abstract class Player
extends Object
implements net.antichess.ai.AiPlayer

Represents an abstract player that can make moves.

Specification Fields :
color : Color // the color of the player

Constructor Summary
Player(Color color)
          Creates a new player of that color
 
Method Summary
abstract  Move askForMove(Move opponentsMove)
          Gets the next move of the player, given the opponents move.
 Move askForMove(Move opponentsMove, long timeRemainingInMillis, long opponentTimeRemainingInMillis)
           
 Color getColor()
           
 String getMove(String lastMove, long timeRemainingInMillis, long opponentTimeRemainingInMillis)
           
 byte[] getPersistentState()
          Filler for now
abstract  void update(Game game)
          Has the player make a series of moves.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Player

public Player(Color color)
Creates a new player of that color

Parameters:
color - of the player
Method Detail

askForMove

public abstract Move askForMove(Move opponentsMove)
Gets the next move of the player, given the opponents move.

Parameters:
opponentsMove - the opponents move
Requires:
opponentsMove not null
Modifies:
state

askForMove

public Move askForMove(Move opponentsMove,
                       long timeRemainingInMillis,
                       long opponentTimeRemainingInMillis)

getMove

public String getMove(String lastMove,
                      long timeRemainingInMillis,
                      long opponentTimeRemainingInMillis)
Specified by:
getMove in interface net.antichess.ai.AiPlayer
See Also:
Piece

getPersistentState

public byte[] getPersistentState()
Filler for now

Specified by:
getPersistentState in interface net.antichess.ai.AiPlayer

getColor

public Color getColor()
Returns:
the color of the player

update

public abstract void update(Game game)
Has the player make a series of moves. Used to get the AI player up to speed on a newly loaded game