Class Promotion

java.lang.Object
com.amirhn.Moves.Move
com.amirhn.Moves.Promotion
Direct Known Subclasses:
PawnPromotion

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

    • move

      public Move move
      The Move.
    • promotedPiece

      public Piece promotedPiece
      The Promoted piece.
  • Constructor Details

    • Promotion

      public Promotion(Move move, PieceType promotedPieceType)
      Instantiates a new Promotion.
      Parameters:
      move - the move
      promotedPieceType - the promoted piece type
  • 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
    • 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
    • toString

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