|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.columbia.cs.coms4701.agent.environments.pente.PentePerceptBoard
public class PentePerceptBoard
A percept describing the complete state of the board.
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 |
---|
public static final int EMPTY
public static final int INVALID
Constructor Detail |
---|
public PentePerceptBoard(int nextTurn, int[][] board)
nextTurn
- board
- an array of ints representing the status of each position on the boardMethod Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public int getPositionStatus(DiscretePoint2D theLocation)
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.
theLocation
- the position
public int[][] getBoard()
public int nextTurn()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |