PiecePromoOptions class
Defines whether a piece can promote or be promoted to.
Constructors
-
PiecePromoOptions({bool canPromote = false, bool canPromoteTo = false, List<
String> ? promotesTo}) -
const
-
PiecePromoOptions.fromJson(Map<
String, dynamic> json) -
factory
-
PiecePromoOptions.promotesTo(List<
String> pieces) -
A piece that can be promoted, but its only options are
pieces
.factory - PiecePromoOptions.promotesToOne(String piece)
-
A piece that can be promoted, but only to
piece
.factory
Properties
- canPromote → bool
-
Whether this piece can be promoted.
final
- canPromoteTo → bool
-
Whether this piece can be promoted to.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
-
promotesTo
→ List<
String> ? -
If this is specified then only pieces in this list will be available as
promotion options for this piece.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Constants
- none → const PiecePromoOptions
- A piece that cannot be promoted and isn't a promotion option.
- promoPiece → const PiecePromoOptions
- A piece that is a promotion option (but cannot be promoted).
- promotable → const PiecePromoOptions
- A piece that can be promoted (but isn't a promotion option).