Class EnPassant


public class EnPassant extends Capture
The type En passant.
  • Field Details

    • secondSource

      public Location secondSource
      The Second source.
    • secondDestination

      public Location secondDestination
      The Second destination.
    • pushPawnMove

      public Walk pushPawnMove
      The Push pawn move.
  • Constructor Details

    • EnPassant

      public EnPassant(Pawn pawn, Pawn capturePawn)
      Instantiates a new En passant.
      Parameters:
      pawn - the pawn
      capturePawn - the capture pawn
  • Method Details

    • applyOnBoard

      public boolean applyOnBoard(Board board)
      Apply on board boolean.
      Overrides:
      applyOnBoard in class Capture
      Parameters:
      board - the board
      Returns:
      the boolean
    • undoOnBoard

      public void undoOnBoard(Board board)
      Undo on board.
      Overrides:
      undoOnBoard in class Capture
      Parameters:
      board - the board
    • isValidApplyOnBoard

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

      public boolean isAllowed(Chess chess)
      Is allowed boolean.
      Overrides:
      isAllowed in class Move
      Parameters:
      chess - the chess
      Returns:
      the boolean
    • toString

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

      public Location getEndpointLocation()
      Gets endpoint location.
      Overrides:
      getEndpointLocation in class Capture
      Returns:
      the endpoint location