Class Castling

java.lang.Object
com.amirhn.Moves.Move
com.amirhn.Moves.Castling
Direct Known Subclasses:
LongCastling, ShortCastling

public abstract class Castling extends Move
The type Castling.
  • Field Details

    • kingMove

      public Walk kingMove
      The King move.
    • rookMove

      public Walk rookMove
      The King move.
    • king

      public King king
      The King.
    • rook

      public Rook rook
      The Rook.
  • Constructor Details

    • Castling

      public Castling(Walk kingMove, Walk rookMove)
      Instantiates a new Castling.
      Parameters:
      kingMove - the king move
      rookMove - the rook move
  • Method Details

    • generate

      public static Castling generate(King king, Rook rook)
      Generate castling.
      Parameters:
      king - the king
      rook - the rook
      Returns:
      the castling
    • isAllowed

      public boolean isAllowed(Chess chess)
      Is allowed boolean.
      Overrides:
      isAllowed in class Move
      Parameters:
      chess - the chess
      Returns:
      the boolean
    • 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
    • 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