Piece class

Describes a chess piece by its color, role and promotion status.

Annotations
  • @immutable

Constructors

Piece({required Side color, required Role role, bool promoted = false})
const

Properties

color Side
final
fenChar String
Gets the FEN character of this piece.
no setter
hashCode int
The hash code for this object.
no setteroverride
kind PieceKind
Gets the piece kind.
no setter
final
role Role
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({Side? color, Role? role, bool? promoted}) Piece
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

fromChar(String ch) Piece?

Constants

blackBishop → const Piece
blackKing → const Piece
blackKnight → const Piece
blackPawn → const Piece
blackQueen → const Piece
blackRook → const Piece
whiteBishop → const Piece
whiteKing → const Piece
whiteKnight → const Piece
whitePawn → const Piece
whiteQueen → const Piece
whiteRook → const Piece