|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.antichess.ai.AntichessAIPlayer
Proposed base class for antichess AI player.
Field Summary | |
protected boolean |
isWhite
a boolean indicating if this player is white or black |
protected String |
ruleSet
the rules under which this player is playing |
Constructor Summary | |
protected |
AntichessAIPlayer(boolean isWhite,
long whiteTimeInMillis,
long blackTimeInMillis,
String ruleSet)
|
Method Summary | |
boolean |
addChattyPlayerListener(ChattyPlayerListener listener)
adds a listener for this player's chat events |
abstract String |
getMove(String lastMove,
long timeRemainingInMillis,
long opponentTimeInMillis)
This is the most important method that a subclass of this class will have to implement. |
abstract String |
getOpeningMove()
If the player is white, then he must make the first move of the game. |
boolean |
removeChattyPlayerListener(ChattyPlayerListener listener)
removes a listener from this player's chat events |
protected void |
sendChat(String message)
a method that the player can call to send a message to his opponent |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final boolean isWhite
protected final String ruleSet
Constructor Detail |
protected AntichessAIPlayer(boolean isWhite, long whiteTimeInMillis, long blackTimeInMillis, String ruleSet)
isWhite
- indicating if the player is white or blackwhiteTimeInMillis
- the amount of time, in milliseconds,
that white will start withblackTimeInMillis
- the amount of time, in milliseconds,
that black will start withruleSet
- the set of rules by which the game will be playedMethod Detail |
public abstract String getOpeningMove()
public abstract String getMove(String lastMove, long timeRemainingInMillis, long opponentTimeInMillis)
lastMove
- String representation of the move expressed as
4 chars matching the following pattern: [a-h][1-8][a-h][1-8]timeRemainingInMillis
- the number of milliseconds that
this AI player has left in the game to make his or her moveopponentTimeInMillis
- the number of milliseconds that
the opponent has left after making his or her last movepublic final boolean addChattyPlayerListener(ChattyPlayerListener listener)
public final boolean removeChattyPlayerListener(ChattyPlayerListener listener)
protected final void sendChat(String message)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |