public abstract class Player
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Player.boardType
the type of game board where the game can be played
|
static class |
Player.playerType
the types of players
|
Modifier and Type | Field and Description |
---|---|
protected long |
maxNodes
how many nodes at most are allowed to be opened
|
protected int |
number
the player number (1,2,...)
|
Constructor and Description |
---|
Player() |
Modifier and Type | Method and Description |
---|---|
boolean |
isComputer()
those players that are not computer players should override this
|
abstract Move |
move(GameState state,
java.util.ArrayList<Move> allowedMoves)
make a single move
|
void |
otherMoved(Move move,
GameState newState)
information about the move made by another player - override if needed
|
double |
ratioTimeLeft()
what is the ratio of the remaining time, i.e.
|
void |
setMaximumNumberOfNodes(long maxNodes)
the number of nodes that can be opened in one move
|
void |
setMaxTime(long maxTime)
configure the maximum time available for one move
|
void |
setPlayerNumber(int pn)
store the player number
|
void |
startMove()
record the time when the move is starting
|
long |
timeUsed()
how much time has been used since the start of this move
|
protected int number
protected long maxNodes
public abstract Move move(GameState state, java.util.ArrayList<Move> allowedMoves) throws java.lang.Exception
java.lang.Exception
public void otherMoved(Move move, GameState newState)
public void startMove()
public void setMaxTime(long maxTime)
public long timeUsed()
public double ratioTimeLeft()
public boolean isComputer()
public void setPlayerNumber(int pn)
public void setMaximumNumberOfNodes(long maxNodes)