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
FieldsModifier and TypeFieldDescriptionThe King.The King move.The Rook.The King move. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanapplyOnBoard(Board board) Apply on board boolean.static CastlingGenerate castling.Gets endpoint location.Gets startpoint location.booleanIs allowed boolean.booleanisValidApplyOnBoard(Board board) Is valid apply on board boolean.voidundoOnBoard(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:
applyOnBoardin classMove- Parameters:
board- the board- Returns:
- the boolean
-
undoOnBoard
Undo on board.- Specified by:
undoOnBoardin classMove- Parameters:
board- the board
-
isValidApplyOnBoard
Is valid apply on board boolean.- Overrides:
isValidApplyOnBoardin classMove- Parameters:
board- the board- Returns:
- the boolean
-
getEndpointLocation
Gets endpoint location.- Specified by:
getEndpointLocationin classMove- Returns:
- the endpoint location
-
getStartpointLocation
Gets startpoint location.- Specified by:
getStartpointLocationin classMove- Returns:
- the startpoint location
-