ai
Class RandomPlayer

java.lang.Object
  extended by core.Player
      extended by ai.RandomPlayer
All Implemented Interfaces:
net.antichess.ai.AiPlayer

public class RandomPlayer
extends Player

An ai player that makes random moves.

Specification Fields :
state : game state // the current state of the came according to the ai

Constructor Summary
RandomPlayer(Color c)
          Creates a new random player of the given color
 
Method Summary
 Move askForMove(Move opponentsMove)
          Gets the next move of the player, given the opponents move.
 void update(Game game)
          Has the player make a series of moves.
 
Methods inherited from class core.Player
askForMove, getColor, getMove, getPersistentState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomPlayer

public RandomPlayer(Color c)
Creates a new random player of the given color

Parameters:
c - color of the player
Requires:
c not null
Method Detail

askForMove

public Move askForMove(Move opponentsMove)
Description copied from class: Player
Gets the next move of the player, given the opponents move.

Specified by:
askForMove in class Player
Parameters:
opponentsMove - the opponents move
See Also:
Player

update

public 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

Specified by:
update in class Player
Parameters:
game - the new game
Requires:
game not null
Modifies:
state