PieceTypeExtensions extension

A class of extensions for PieceType

on

Properties

canBeInHand bool
Returns whether a piece can be in hand
no setter
canBePromoted bool
Whether the piece type can be promoted
no setter
isPromoted bool
Whether the piece type is promoted
no setter

Methods

normalize() PieceType
Returns a normalized equivalent for the piece type (i.e. PieceType.pawnPromoted => PieceType.pawn).
promote() PieceType
Returns a promoted equivalent for the piece type. Returns itself if the piece type cannot be promoted.

Static Properties

convertPromotedPieceTypeToPieceType Map<PieceType, PieceType>
A map of promoted piece types and their standard equivalents
final