My Project
Public Member Functions | List of all members
King Class Reference
Inheritance diagram for King:
ChessPiece

Public Member Functions

 King (int x, int y, PieceColor color)
 
boolean isValidMove (ChessBoard chessBoard, int moveToX, int moveToY)
 
char boardCharacter ()
 
- Public Member Functions inherited from ChessPiece
 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 ()
 

Additional Inherited Members

- Public Attributes inherited from ChessPiece
int x
 
int y
 

Constructor & Destructor Documentation

◆ King()

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

Member Function Documentation

◆ boardCharacter()

char King.boardCharacter ( )
inline

character representation on board

Returns

◆ isValidMove()

boolean King.isValidMove ( ChessBoard  chessBoard,
int  moveToX,
int  moveToY 
)
inline
Parameters
chessBoardwe are playing on
moveToXwhere we want to move to x
moveToYwhere we want to move to y
Returns
checks if valid move for king

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