promote method

PieceType promote()

Returns a promoted equivalent for the piece type. Returns itself if the piece type cannot be promoted.

Implementation

PieceType promote() =>
    canBePromoted ? _convertPieceTypeToPromotedPieceType[this]! : this;