public class ChessBoard
Modifier and Type | Method and Description |
---|---|
int |
currentTurn()
Return the number of turns that have been completed.
|
Piece |
pieceAt(int row,
int column)
Return the piece at an indicated position, if any.
|
void |
placePiece(Piece piece,
int row,
int column)
Add a chess piece to the board at the indicated empty position.
|
void |
replacePiece(Piece oldPiece,
Piece newPiece,
int row,
int column)
Replace a piece on the board with a new piece.
|
public int currentTurn()
public Piece pieceAt(int row, int column)
row
- The vertical position in which to lookcolumn
- The horizontal position in which to lookpublic void placePiece(Piece piece, int row, int column)
piece
- The piece to add to the boardrow
- The vertical position in which to place the piececolumn
- The horizontal position in which to place the piecepublic void replacePiece(Piece oldPiece, Piece newPiece, int row, int column)
oldPiece
-
The piece to be replacednewPiece
- The piece
with which to replace itrow
- The vertical position in which to place the piececolumn
- The horizontal position in which to place the piece