java.lang.Object
app.chess.AbstractChessPiece
app.chess.pieces.Rook
- All Implemented Interfaces:
Piece
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
getKind()
void
void
This function effectively copies all state from another piece.Methods inherited from class app.chess.AbstractChessPiece
enPassantable, getColor, getPlayer, getPosition, isAlive, resetMoved, toString, wrap
-
Field Details
-
wasMovedBefore
boolean wasMovedBefore
-
-
Constructor Details
-
Rook
-
Rook
-
-
Method Details
-
overwriteState
Description copied from class:AbstractChessPiece
This function effectively copies all state from another piece.
Please, use it with caution under acceptable circumstances.
Passing incompatible pieces might result in an exception.- Overrides:
overwriteState
in classAbstractChessPiece
-
getKind
- Overrides:
getKind
in classAbstractChessPiece
-
getPotentialMoves
- Specified by:
getPotentialMoves
in classAbstractChessPiece
- Returns:
- A list of ChessMoves that are potentially valid (i.e. the caller needs to check if king's safety is ok and whether path to the given field isn't obstructed
-
move
- Overrides:
move
in classAbstractChessPiece
-
canParticipateInCastling
public boolean canParticipateInCastling()- Overrides:
canParticipateInCastling
in classAbstractChessPiece
-