Package javachess.model
Class Piece
java.lang.Object
javachess.model.Piece
Abstract class representing a chess piece.
This class serves as a base for all specific piece types (e.g., Pawn, Rook, Knight, etc.).
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
decorator
-
-
Constructor Details
-
Piece
-
Piece
-
-
Method Details
-
getColor
-
hasMoved
public boolean hasMoved() -
setMoved
public void setMoved() -
getCell
-
getType
-
getDecorator
-
findFile
Finds the filename of the image representing the piece. The filename is constructed based on the color and type of the piece.- Returns:
- The filename of the image representing the piece.
-
equals
-
hashCode
public int hashCode() -
toString
-
setCell
-
getFEN
public char getFEN()Returns the FEN character representing the piece.- Returns:
- The FEN character representing the piece.
-