|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object referee.Board
public class Board
Title: Board
Description: Represents a checker position
Copyright: Copyright (c) 2004
Company: Eastern Michigan University
Field Summary | |
---|---|
static int |
BLACK_KING
In an array of ints, ARR, representing a board position, this value at ARR[i] indicates that there is a black king at position i. |
static int |
BLACK_PAWN
Indicates there is a black pawn at position i. |
static int |
NO_PIECE
Indicates there is no piece at position i. |
static int |
NUM_SQUARES
Number of legal positions on a game board |
static int |
WHITE_KING
Indicates there is a white king at position i. |
static int |
WHITE_PAWN
Indicates there is a white pawn at position i. |
Constructor Summary | |
---|---|
Board()
Generates a starting board. |
|
Board(Board orig)
Copy constructor. |
|
Board(int[] boardArr,
boolean isWhitePlayer)
Constructs a board with pieces arranged as specified by boardArr. |
Method Summary | |
---|---|
boolean |
isNoLegalMove()
|
boolean |
isWhitesMove()
|
static void |
main(java.lang.String[] args)
|
int |
numBlacks()
numBlacks |
int |
numWhites()
numWhites |
int[] |
toArray()
toArray |
java.lang.String |
toString()
|
java.lang.Object |
updateBoard(int[] move)
Modify the board to reflect the given move. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int NUM_SQUARES
public static final int BLACK_KING
public static final int NO_PIECE
public static final int WHITE_PAWN
public static final int WHITE_KING
public static final int BLACK_PAWN
Constructor Detail |
---|
public Board()
public Board(Board orig)
orig
- Boardpublic Board(int[] boardArr, boolean isWhitePlayer)
boardArr
- int[]isWhitePlayer
- booleanMethod Detail |
---|
public boolean isWhitesMove()
public java.lang.Object updateBoard(int[] move)
public int numWhites()
public int numBlacks()
public int[] toArray()
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
public boolean isNoLegalMove()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |