Class Capture

java.lang.Object
com.amirhn.Moves.Move
com.amirhn.Moves.Capture
Direct Known Subclasses:
EnPassant

public class Capture extends Move
The type Capture.
  • Field Details

    • source

      public Location source
      The Source.
    • destination

      public Location destination
      The Destination.
    • capturePiece

      public Piece capturePiece
      The Capture piece.
  • Constructor Details

    • Capture

      public Capture(Piece piece, Piece capturePiece)
      Instantiates a new Capture.
      Parameters:
      piece - the piece
      capturePiece - the capture piece
  • Method Details

    • applyOnBoard

      public boolean applyOnBoard(Board board)
      Apply on board boolean.
      Specified by:
      applyOnBoard in class Move
      Parameters:
      board - the board
      Returns:
      the boolean
    • undoOnBoard

      public void undoOnBoard(Board board)
      Undo on board.
      Specified by:
      undoOnBoard in class Move
      Parameters:
      board - the board
    • isValidApplyOnBoard

      public boolean isValidApplyOnBoard(Board board)
      Is valid apply on board boolean.
      Overrides:
      isValidApplyOnBoard in class Move
      Parameters:
      board - the board
      Returns:
      the boolean
    • toString

      public String toString()
      To string string.
      Overrides:
      toString in class Object
      Returns:
      the string
    • getEndpointLocation

      public Location getEndpointLocation()
      Gets endpoint location.
      Specified by:
      getEndpointLocation in class Move
      Returns:
      the endpoint location
    • getStartpointLocation

      public Location getStartpointLocation()
      Gets startpoint location.
      Specified by:
      getStartpointLocation in class Move
      Returns:
      the startpoint location