knockabout
Class Player

java.lang.Object
  extended byknockabout.Player
Direct Known Subclasses:
RandomPlayer, SearcherPlayer

public abstract class Player
extends java.lang.Object

Standard KnockAbout Player Class Provides a set of functions that an agent should inherit (i.e. Your AIPlayer class should be a subclass of this one)


Field Summary
static int BLACK
           
static int DRAW
           
static int NOCOLOR
           
static int YELLOW
           
 
Method Summary
abstract  Move chooseMove(Board board)
           
 int getMyColor()
           
 java.lang.String getMyName()
           
static int opponentColor(int color)
          Utility method that return the opponent's color given your color
 void setMyColor(int _color)
          Sets an agent's color
 void setMyName(java.lang.String _name)
          Sets an agent's name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLACK

public static final int BLACK
See Also:
Constant Field Values

YELLOW

public static final int YELLOW
See Also:
Constant Field Values

DRAW

public static final int DRAW
See Also:
Constant Field Values

NOCOLOR

public static final int NOCOLOR
See Also:
Constant Field Values
Method Detail

opponentColor

public static int opponentColor(int color)
Utility method that return the opponent's color given your color


setMyName

public void setMyName(java.lang.String _name)
Sets an agent's name


setMyColor

public void setMyColor(int _color)
Sets an agent's color


getMyColor

public int getMyColor()

getMyName

public java.lang.String getMyName()

chooseMove

public abstract Move chooseMove(Board board)
Parameters:
board - The current board position
Returns:
The move that seems the most promising for the agent