Module org.example

Class Pawn

java.lang.Object
cz.cvut.fel.pjv.model.Pieces.Piece
cz.cvut.fel.pjv.model.Pieces.Pawn
All Implemented Interfaces:
java.io.Serializable

public class Pawn
extends Piece
Class representation of the pawn piece.
See Also:
Serialized Form
  • Constructor Details

    • Pawn

      public Pawn​(boolean white)
      Create pawn piece
      Parameters:
      white -
  • Method Details

    • setDidElPassant

      public void setDidElPassant​(boolean didElPassant)
    • isDidElPassant

      public boolean isDidElPassant()
    • setPromotion

      public void setPromotion​(boolean promotion)
    • isPromotion

      public boolean isPromotion()
    • isWasLastSuperJump

      public boolean isWasLastSuperJump()
    • setWasLastSuperJump

      public void setWasLastSuperJump​(boolean wasLastSuperJump)
    • canMove

      public boolean canMove​(Board board, Spot start, Spot end) throws java.lang.Exception
      Methode to validate if the move is possible.
      Specified by:
      canMove in class Piece
      Parameters:
      board -
      start -
      end -
      Returns:
      Throws:
      java.lang.Exception
    • getPieceSymbol

      public java.lang.String getPieceSymbol()
      Method to get a symbol of the piece for print on board.
      Specified by:
      getPieceSymbol in class Piece
      Returns:
    • colorRegulator

      public static int colorRegulator​(Piece piece)
      Internal method to determine board orientation.
      Parameters:
      piece -
      Returns:
    • toString

      public java.lang.String toString()
      Method to get a symbol of the piece for print on console board.
      Overrides:
      toString in class java.lang.Object
      Returns: