My Project
Public Member Functions | List of all members
ChessBoard Class Reference

Public Member Functions

 ChessBoard (int row, int col, boolean putPieces)
 
void putPieces ()
 
int getXKingLocation (PieceColor color)
 
int getYKingLocation (PieceColor color)
 
boolean movePiece (int moveFromX, int moveFromY, int moveToX, int moveToY)
 
int inCheck (int moveFromX, int moveFromY, int moveToX, int moveToY)
 
ChessPiece getChessPiece (int x, int y)
 
int getCol ()
 
int getRow ()
 
boolean isFree (int x, int y)
 
ChessPiece [][] getChessBoard ()
 

Member Function Documentation

◆ getChessBoard()

ChessPiece [][] ChessBoard.getChessBoard ( )
inline
Returns
chessboard

◆ getChessPiece()

ChessPiece ChessBoard.getChessPiece ( int  x,
int  y 
)
inline
Parameters
xcoordinate
ycoordinate
Returns
chesspiece at x,y coordinate

◆ getCol()

int ChessBoard.getCol ( )
inline
Returns
number of columns

◆ getRow()

int ChessBoard.getRow ( )
inline
Returns
number of rows

◆ getXKingLocation()

int ChessBoard.getXKingLocation ( PieceColor  color)
inline
Parameters
color
Returns
returns King colors X location

◆ getYKingLocation()

int ChessBoard.getYKingLocation ( PieceColor  color)
inline
Parameters
color
Returns
returns King colors Y location

◆ inCheck()

int ChessBoard.inCheck ( int  moveFromX,
int  moveFromY,
int  moveToX,
int  moveToY 
)
inline
Parameters
moveFromXPiece that we want to move at X coordinate
moveFromYPiece that we want to move at Y coordinate
moveToXWhere we want to move piece to X coordinate
moveToYWhere we want to move piece to Y coordiante
Returns
whether and what king is in check

◆ isFree()

boolean ChessBoard.isFree ( int  x,
int  y 
)
inline
Parameters
xcoordinate
ycoordinate
Returns
whether space is free at given x,y coordinate

◆ movePiece()

boolean ChessBoard.movePiece ( int  moveFromX,
int  moveFromY,
int  moveToX,
int  moveToY 
)
inline
Parameters
moveFromXPiece that we want to move at X coordinate
moveFromYPiece that we want to move at Y coordinate
moveToXWhere we want to move piece to X coordinate
moveToYWhere we want to move piece to Y coordiante
Returns
allowed to move piece to given coordinate

◆ putPieces()

void ChessBoard.putPieces ( )
inline

Automates putting the pieces as they normally would be on the chess board


The documentation for this class was generated from the following file: