|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webstersmalley.chessweb.model.Board
public class Board
Represents the current state of the chessboard.
Constructor Summary | |
---|---|
Board()
|
Method Summary | |
---|---|
Piece |
getAt(Position pos)
Return the piece at a given position. |
Piece |
getAt(java.lang.String file,
int rank)
Return the piece at a given location. |
java.lang.String |
getChecked()
Returns a message indicating if either team is checked. |
int |
getHeight()
Accessor for the height variable. |
MoveHistory |
getMoveHistory()
|
Team |
getNextTurn()
|
java.util.Collection |
getSquares()
Returns the collection of all Squares. |
int |
getWidth()
Accessor for the width variable. |
boolean |
isBlackChecked()
|
boolean |
isOnBoard(Position position)
Checks whether a given position is on the board. |
boolean |
isWhiteChecked()
|
void |
movePiece(Move move)
Move a piece from one position to another. |
void |
place(Position pos,
Piece piece)
Place a piece at a position. |
void |
setBlackChecked(boolean blackChecked)
|
void |
setHeight(int height)
Mutator for the height variable. |
void |
setNextTurn(Team nextTurn)
|
protected void |
setup()
Sets up the Square objects. |
void |
setWhiteChecked(boolean whiteChecked)
|
void |
setWidth(int width)
Mutator for the width variable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Board()
Method Detail |
---|
protected final void setup()
public final int getHeight()
public final void setHeight(int height)
height
- the new height.public final int getWidth()
public final void setWidth(int width)
width
- the new width.public final Piece getAt(Position pos)
pos
- the Position.
public final Piece getAt(java.lang.String file, int rank)
file
- the file coordinaterank
- the rank coordinate
public final void movePiece(Move move) throws InvalidMoveException
move
- the move
InvalidMoveException
- if the move is invalidpublic final void place(Position pos, Piece piece)
pos
- the positionpiece
- the piecepublic final java.util.Collection getSquares()
public final boolean isOnBoard(Position position)
position
- the position
public final MoveHistory getMoveHistory()
public final void setNextTurn(Team nextTurn)
nextTurn
- The nextTurn to set.public final Team getNextTurn()
public final boolean isBlackChecked()
public final void setBlackChecked(boolean blackChecked)
blackChecked
- The blackChecked to set.public final boolean isWhiteChecked()
public final void setWhiteChecked(boolean whiteChecked)
whiteChecked
- The whiteChecked to set.public final java.lang.String getChecked()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |