Package com.amirhn.Moves
Class Capture
java.lang.Object
com.amirhn.Moves.Move
com.amirhn.Moves.Capture
- Direct Known Subclasses:
EnPassant
The type Capture.
-
Field Summary
Modifier and TypeFieldDescriptionThe Capture piece.The Destination.The Source. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
applyOnBoard
(Board board) Apply on board boolean.Gets endpoint location.Gets startpoint location.boolean
isValidApplyOnBoard
(Board board) Is valid apply on board boolean.toString()
To string string.void
undoOnBoard
(Board board) Undo on board.
-
Field Details
-
source
The Source. -
destination
The Destination. -
capturePiece
The Capture piece.
-
-
Constructor Details
-
Capture
Instantiates a new Capture.- Parameters:
piece
- the piececapturePiece
- the capture piece
-
-
Method Details
-
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
-
toString
To string string. -
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
-