Package com.amirhn.Moves
Class Castling
java.lang.Object
com.amirhn.Moves.Move
com.amirhn.Moves.Castling
- Direct Known Subclasses:
LongCastling
,ShortCastling
The type Castling.
-
Field Summary
Modifier and TypeFieldDescriptionThe King.The King move.The Rook.The King move. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
applyOnBoard
(Board board) Apply on board boolean.static Castling
Generate castling.Gets endpoint location.Gets startpoint location.boolean
Is allowed boolean.boolean
isValidApplyOnBoard
(Board board) Is valid apply on board boolean.void
undoOnBoard
(Board board) Undo on board.
-
Field Details
-
kingMove
The King move. -
rookMove
The King move. -
king
The King. -
rook
The Rook.
-
-
Constructor Details
-
Castling
Instantiates a new Castling.- Parameters:
kingMove
- the king moverookMove
- the rook move
-
-
Method Details
-
generate
Generate castling.- Parameters:
king
- the kingrook
- the rook- Returns:
- the castling
-
isAllowed
Is allowed boolean. -
applyOnBoard
Apply on board boolean.- Specified by:
applyOnBoard
in classMove
- Parameters:
board
- the board- Returns:
- the boolean
-
undoOnBoard
Undo on board.- Specified by:
undoOnBoard
in classMove
- Parameters:
board
- the board
-
isValidApplyOnBoard
Is valid apply on board boolean.- Overrides:
isValidApplyOnBoard
in classMove
- Parameters:
board
- the board- Returns:
- the boolean
-
getEndpointLocation
Gets endpoint location.- Specified by:
getEndpointLocation
in classMove
- Returns:
- the endpoint location
-
getStartpointLocation
Gets startpoint location.- Specified by:
getStartpointLocation
in classMove
- Returns:
- the startpoint location
-