|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--CheckerBoard
This class defines a CheckerBoard. and provides several methods for manipulating them. A CheckerBoard has one field, board, which is an array of Positions.
| Field Summary | |
Position[] |
board
|
| Constructor Summary | |
CheckerBoard()
Initializes the CheckerBoard, setting all pieces to empty 'e'. |
|
CheckerBoard(java.lang.String s)
Initializes the CheckerBoard by using the board defintion from the server to set the pieces. |
|
| Method Summary | |
static CheckerBoard |
Copy(CheckerBoard b)
Given a CheckerBoard, returns a copy. |
boolean |
isEmpty(int i)
Returns true if the piece at position i is 'e'. |
char |
Piece(int i)
Given a board position number, returns the piece at that location. |
void |
PrintBoard()
Prints the Checkerboard in a format that is easy to understand by people |
void |
SetPiece(int i,
char c)
Set the piece at position i to be c. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public Position[] board
| Constructor Detail |
public CheckerBoard()
public CheckerBoard(java.lang.String s)
| Method Detail |
public char Piece(int i)
public boolean isEmpty(int i)
public void SetPiece(int i,
char c)
public void PrintBoard()
public static CheckerBoard Copy(CheckerBoard b)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||