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

Public Member Functions

 Pawn (int x, int y, PieceColor color)
 
boolean makeMove (ChessBoard chessBoard, int moveToX, int moveToY)
 
boolean isValidMove (ChessBoard chessBoard, int moveToX, int moveToY)
 
void replacePawn (ChessBoard chessBoard)
 
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

◆ Pawn()

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

Member Function Documentation

◆ boardCharacter()

char Pawn.boardCharacter ( )
inline

character representation on board

Returns

◆ isValidMove()

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

◆ makeMove()

boolean Pawn.makeMove ( ChessBoard  chessBoard,
int  moveToX,
int  moveToY 
)
inline
Parameters
chessBoardwe are playing on
moveToXwhere we are moving piece to
moveToYwhere we are moving piece to
Returns
whether move was made

◆ replacePawn()

void Pawn.replacePawn ( ChessBoard  chessBoard)
inline
Parameters
chessBoardchessboard we are playing on changes pawn we are playing with either Queen (1) or Knight (2) from user input

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