edu.columbia.cs.coms4701.agent.environments.pente
Class PentePerceptBoard

java.lang.Object
  extended by edu.columbia.cs.coms4701.agent.environments.pente.PentePerceptBoard
All Implemented Interfaces:
AgentPercept, PentePercept

public class PentePerceptBoard
extends java.lang.Object
implements PentePercept

A percept describing the complete state of the board.

Version:
0.1

User: aaron Date: Sep 24, 2006 Time: 8:21:29 PM

Author:
aaron@cs

Field Summary
static int EMPTY
          An integer that indicates a position on the board is empty.
static int INVALID
          An integer that indicates a position is not on the board.
 
Constructor Summary
PentePerceptBoard(int nextTurn, int[][] board)
          Constructs a new Board percept from the given turn and board.
 
Method Summary
 int[][] getBoard()
          Returns an array of ints representing the status of each position on the board.
 int getPositionStatus(DiscretePoint2D theLocation)
          Returns the status of a location on the board.
 int nextTurn()
          Returns an integer indicating whose turn is next.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final int EMPTY
An integer that indicates a position on the board is empty.

See Also:
Constant Field Values

INVALID

public static final int INVALID
An integer that indicates a position is not on the board.

See Also:
Constant Field Values
Constructor Detail

PentePerceptBoard

public PentePerceptBoard(int nextTurn,
                         int[][] board)
Constructs a new Board percept from the given turn and board.

Parameters:
nextTurn -
board - an array of ints representing the status of each position on the board
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getPositionStatus

public int getPositionStatus(DiscretePoint2D theLocation)
Returns the status of a location on the board.

If the position is empty, returns PentePerceptBoard.EMPTY.

If the position is beyond the bounds of the board, returns PentePerceptBoard.INVALID

If the position contains a stone, returns an integer indicating the owner of the stone.

Parameters:
theLocation - the position
Returns:
an integer representing either

getBoard

public int[][] getBoard()
Returns an array of ints representing the status of each position on the board.


nextTurn

public int nextTurn()
Returns an integer indicating whose turn is next.

Returns:
turn indicator