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

Public Member Functions

 Bishop (int x, int y, PieceColor color)
 
boolean isValidMove (ChessBoard chessBoard, int moveToX, int moveToY)
 
boolean checkDiagonal (ChessBoard chessBoard, int startX, int startY, int endX, int endY)
 
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
 

Member Function Documentation

◆ boardCharacter()

char Bishop.boardCharacter ( )
inline
Returns
character representation on board

◆ checkDiagonal()

boolean Bishop.checkDiagonal ( ChessBoard  chessBoard,
int  startX,
int  startY,
int  endX,
int  endY 
)
inline
Parameters
chessBoarditself
startXwhere chesspiece is starting x coordinate
startYwhere chesspiece is starting y coordinate
endXwhere chesspiece is ending x coordinate
endYwhere chesspiece is ending
Returns
checks diagonals and see if its a valid move

◆ isValidMove()

boolean Bishop.isValidMove ( ChessBoard  chessBoard,
int  moveToX,
int  moveToY 
)
inline
Parameters
chessBoarditself
moveToXwhere to move to x coordinate
moveToYwhere to move to y coordinate
Returns
whether given move is a valid move

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