Class Move

java.lang.Object
com.amirhn.Moves.Move
Direct Known Subclasses:
Capture, Castling, Promotion, Walk

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

    • type

      public final MoveType type
      The Type.
    • piece

      public Piece piece
      The Piece.
  • Constructor Details

    • Move

      public Move(MoveType type, Piece piece)
      Instantiates a new Move.
      Parameters:
      type - the type
      piece - the piece
  • Method Details

    • isAllowed

      public boolean isAllowed(Chess chess)
      Is allowed boolean.
      Parameters:
      chess - the chess
      Returns:
      the boolean
    • applyOnBoard

      public abstract boolean applyOnBoard(Board board)
      Apply on board boolean.
      Parameters:
      board - the board
      Returns:
      the boolean
    • undoOnBoard

      protected abstract void undoOnBoard(Board board)
      Undo on board.
      Parameters:
      board - the board
    • isValidApplyOnBoard

      public boolean isValidApplyOnBoard(Board board)
      Is valid apply on board boolean.
      Parameters:
      board - the board
      Returns:
      the boolean
    • getStartpointLocation

      public abstract Location getStartpointLocation()
      Gets startpoint location.
      Returns:
      the startpoint location
    • getEndpointLocation

      public abstract Location getEndpointLocation()
      Gets endpoint location.
      Returns:
      the endpoint location