Piece

data class Piece(val pieceType: PieceType, val color: PieceColor)

Represents a chess piece with a specific type and color.

Constructors

Link copied to clipboard
constructor(pieceType: PieceType, color: PieceColor)

Properties

Link copied to clipboard

The color of the chess piece (WHITE or BLACK).

Link copied to clipboard

The type of the chess piece (e.g., PAWN, KNIGHT).

Functions

Link copied to clipboard
open override fun toString(): String

Returns a single-character string representation of the piece. Uppercase for white, lowercase for black.