|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectAbstractGameBoard
public abstract class AbstractGameBoard
AbstractGameBoard class This class is to provide some structure to the GameBoard interface for two player turn based games with 6 pieces or less
| Field Summary | |
|---|---|
int[][] |
cells
|
static int |
ILLEGAL
used to represent an illegal cell on the board that can have no other value in it |
static int |
NOTHING
used to represent nothing being in a cell on the game board |
static int |
PLAYER1_1
used to represent player 1's first piece |
static int |
PLAYER1_2
used to represent player 1's second piece |
static int |
PLAYER1_3
used to represent player 1's third piece |
static int |
PLAYER1_4
used to represent player 1's fourth piece |
static int |
PLAYER1_5
used to represent player 1's fifth piece |
static int |
PLAYER1_6
used to represent player 1's sixth piece |
static int |
PLAYER2_1
used to represent player 2's first piece |
static int |
PLAYER2_2
used to represent player 2's second piece |
static int |
PLAYER2_3
used to represent player 2's third piece |
static int |
PLAYER2_4
used to represent player 2's fourth piece |
static int |
PLAYER2_5
used to represent player 2's fifth piece |
static int |
PLAYER2_6
used to represent player 2's sixth piece |
int |
turn
|
| Constructor Summary | |
|---|---|
AbstractGameBoard()
|
|
| Method Summary | |
|---|---|
void |
changeTurn()
changeTurn used to change the current value of turn |
abstract java.lang.String |
checkStatus(boolean findCheckMate)
chackStatus used to check the status of a game (winner, loser, draw, etc.) |
void |
chooseCell(int row,
int col,
int value)
chooseCell used to put a value into a cell |
abstract AbstractGameBoard |
clone()
clone used to "clone" the gameboard and return the same board |
abstract int |
getCaptured()
getCaptured used to find out the piece that was captured |
int |
getCell(int row,
int col)
getCell used to return the value in a cell |
int |
getTurn()
getTurn used to return the value of turn |
abstract java.lang.Boolean |
isLegalMove(java.lang.Object testMove,
java.lang.Boolean commitMove)
isLegalMove used to see if a Dimension(should be parsed into two ints to get the row and col of the game board)is a legal "move" and if commitMove is set to true it will actually commit the move |
abstract java.lang.Boolean |
noMove()
noMove() used to see if a player has no where to move |
abstract void |
resetBoard()
resetBoard used to reset the board back to its default setting |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public int[][] cells
public int turn
public static final int NOTHING
public static final int PLAYER1_1
public static final int PLAYER1_2
public static final int PLAYER1_3
public static final int PLAYER1_4
public static final int PLAYER1_5
public static final int PLAYER1_6
public static final int PLAYER2_1
public static final int PLAYER2_2
public static final int PLAYER2_3
public static final int PLAYER2_4
public static final int PLAYER2_5
public static final int PLAYER2_6
public static final int ILLEGAL
| Constructor Detail |
|---|
public AbstractGameBoard()
| Method Detail |
|---|
public void chooseCell(int row,
int col,
int value)
row - the row of the cell that is being choosencol - the column of the cell that is being choosenvalue - the value that will be placed in the cellpublic void changeTurn()
public int getTurn()
public int getCell(int row,
int col)
row - the row of the cell that the user wishes to getcol - the column of the cell that the user wishes to get
public abstract java.lang.Boolean isLegalMove(java.lang.Object testMove,
java.lang.Boolean commitMove)
testMove - the dimension(row, col) of the cellcommitMove - whether or not the move should be commited
public abstract void resetBoard()
public abstract java.lang.String checkStatus(boolean findCheckMate)
public abstract java.lang.Boolean noMove()
public abstract AbstractGameBoard clone()
clone in class java.lang.Objectpublic abstract int getCaptured()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||