antichess
Interface GamePlayer<M extends Move>

All Known Subinterfaces:
HumanPlayer<M>, TextGamePlayer
All Known Implementing Classes:
AIPlayer, ChessPlayer, RandomAI, TextAIPlayer, TextPlayer

public interface GamePlayer<M extends Move>

The GamePlayer interface allows for communication between the contoller and objects that generate moves such as the view or the AI.

Author:
nlharr

Method Summary
 boolean automaticallyTimed()
          If a GamePlayer is automatically timed the time is handled by the GameController if it is not automatically timed, the time for a move needs to be handled by the GamePlayer
 void gameEnded()
          Informs the player that this game is over, and it will not be asked for any more moves.
 M getMove(GameController controller)
          Asks the player for a move, if the player has a move the move is returned, if the player doesn't, null is returned immediately Once this GamePlayer is able to return a valid move it calls notifyControllerHasMove() on the controller.
 Player getPlayerType()
           
 

Method Detail

getMove

M getMove(GameController controller)
Asks the player for a move, if the player has a move the move is returned, if the player doesn't, null is returned immediately Once this GamePlayer is able to return a valid move it calls notifyControllerHasMove() on the controller.


gameEnded

void gameEnded()
Informs the player that this game is over, and it will not be asked for any more moves. This could happen for a number of reasons, including one player winning, or a human user cancelling the game.


getPlayerType

Player getPlayerType()
Returns:
Player for this

automaticallyTimed

boolean automaticallyTimed()
If a GamePlayer is automatically timed the time is handled by the GameController if it is not automatically timed, the time for a move needs to be handled by the GamePlayer

Returns:
if the time for this player is handled automatically by the GameController