My Project
Public Member Functions | Public Attributes | List of all members
ChessPiece Class Reference
Inheritance diagram for ChessPiece:
Bishop King Knight Pawn Queen Rook

Public Member Functions

 ChessPiece (int x, int y, PieceColor color)
 
boolean makeMove (ChessBoard chessBoard, int moveToX, int moveToY)
 
char boardCharacter ()
 
boolean isValidMove (ChessBoard chessBoard, int moveToX, int moveToY)
 
int [] getCoordinates ()
 
PieceColor getColor ()
 

Public Attributes

int x
 
int y
 

Constructor & Destructor Documentation

◆ ChessPiece()

ChessPiece.ChessPiece ( int  x,
int  y,
PieceColor  color 
)
inline
Parameters
xcoordinate
ycoordinate
colorof piece

Member Function Documentation

◆ boardCharacter()

char ChessPiece.boardCharacter ( )
inline

board representation of typical piece or null needs to be overridden

Returns

◆ getColor()

PieceColor ChessPiece.getColor ( )
inline

gets pieces color

Returns

◆ getCoordinates()

int [] ChessPiece.getCoordinates ( )
inline

gets coordinaes of piece in array of length 2

Returns

◆ isValidMove()

boolean ChessPiece.isValidMove ( ChessBoard  chessBoard,
int  moveToX,
int  moveToY 
)
inline
Parameters
chessBoardwe are playing to
moveToXwhere we want to move piece to x
moveToYwhere we want to move piece to y
Returns

◆ makeMove()

boolean ChessPiece.makeMove ( ChessBoard  chessBoard,
int  moveToX,
int  moveToY 
)
inline
Parameters
chessBoardwe are playing on
moveToX
moveToY
Returns

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