Package com.chess.backend.gamemodel
Class Piece
java.lang.Object
com.chess.backend.gamemodel.Piece
Represents a piece.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAllowedFullMoves
(Chessboard chessboard) Returns all allowed moves of the piece.getAllowedMoves
(Chessboard chessboard) Converts AllowedFullMoves to an array of Squares representing only the destination of the move.getColor()
toString()
-
Constructor Details
-
Piece
-
-
Method Details
-
getAllowedFullMoves
Returns all allowed moves of the piece. The moves for each pieceType are composed of several abstract moves.- Parameters:
chessboard
- Chessboard- Returns:
- A HashSet of all allowed moves of the piece in this individual game context.
-
getAllowedMoves
Converts AllowedFullMoves to an array of Squares representing only the destination of the move.- Parameters:
chessboard
- Chessboard- Returns:
- ArrayList of possible Squares to move to.
-
getColor
-
getSymbol
-
getPosition
-
toString
-