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
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Pawn(boolean white)Create pawn piece -
Method Summary
Modifier and Type Method Description booleancanMove(Board board, Spot start, Spot end)Methode to validate if the move is possible.static intcolorRegulator(Piece piece)Internal method to determine board orientation.java.lang.StringgetPieceSymbol()Method to get a symbol of the piece for print on board.booleanisDidElPassant()booleanisPromotion()booleanisWasLastSuperJump()voidsetDidElPassant(boolean didElPassant)voidsetPromotion(boolean promotion)voidsetWasLastSuperJump(boolean wasLastSuperJump)java.lang.StringtoString()Method to get a symbol of the piece for print on console board.Methods inherited from class cz.cvut.fel.pjv.model.Pieces.Piece
isChecking, isKilled, isKingInDanger, isWhite, setKilled, setWhiteMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
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
Methode to validate if the move is possible. -
getPieceSymbol
public java.lang.String getPieceSymbol()Method to get a symbol of the piece for print on board.- Specified by:
getPieceSymbolin classPiece- Returns:
-
colorRegulator
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:
toStringin classjava.lang.Object- Returns:
-