edu.lhup.ai
Interface IPlayer

All Known Implementing Classes:
ConsolePlayer, MinMaxAlphaBetaPlayer, RandomPlayer

public interface IPlayer

The abstract representation of a player. A player is capable of playing any game that implements the IBoard interface.

This software is for educational purposes only.

Author:
Mark Cohen

Method Summary
 String getDescription()
           
 String getShortDescription()
           
 void setCutoff(int cutoff)
          Provides a mechanism for specifying the point at which a player's abandons the search for the best move.
 void setEvaluator(IEvaluator evaluator)
          Provides a mechanism for specifying a player's evaluation strategy.
 void takeTurn(IBoard board)
          Asks this player to push a move onto the specified game's stack.
 

Method Detail

getDescription

public String getDescription()
Returns:
a description of this player.

getShortDescription

public String getShortDescription()
Returns:
a short description of this player.

setEvaluator

public void setEvaluator(IEvaluator evaluator)
Provides a mechanism for specifying a player's evaluation strategy. By implementing the IEvaluator interface programmers can create their own custom evaluators and request that a player use the evaluator by calling this method.

Parameters:
evaluator - the strategy used by this player in order to evaluate the current game state.

setCutoff

public void setCutoff(int cutoff)
Provides a mechanism for specifying the point at which a player's abandons the search for the best move.

Parameters:
cutoff - an integer limiting the duration of a player's search for the best move

takeTurn

public void takeTurn(IBoard board)
              throws TurnException
Asks this player to push a move onto the specified game's stack. The game must be an implementation of IBoard.

Parameters:
board - the IBoard object that this player will make a move on.
Throws:
TurnException - if the player attemts to push an invalid move onto the games stack.