Piece

data class Piece(val coordinate: Coordinate, val value: PieceType, val isGhostPiece: Boolean = false)

Represents a piece on the board with its location and type.

Constructors

Link copied to clipboard
constructor(coordinate: Coordinate, value: PieceType, isGhostPiece: Boolean = false)

Properties

Link copied to clipboard

The location of the piece on the board.

Link copied to clipboard

Indicates if this is a ghost piece (typically used for UI highlighting).

Link copied to clipboard

The type of piece (BLACK or WHITE).

Functions

Link copied to clipboard
fun swap(): Piece

Returns a new Piece with the opposite color at the same coordinate.