copyWith method

PieceType copyWith({
  1. String? betza,
  2. List<MoveDefinition>? moves,
  3. bool? royal,
  4. PiecePromoOptions? promoOptions,
  5. bool? enPassantable,
  6. bool? noSanSymbol,
  7. int? value,
  8. List<RegionEffect>? regionEffects,
  9. List<Action>? actions,
  10. PieceOptimisationData? optimisationData,
})

Returns a copy of this piece type with some properties changed.

Implementation

PieceType copyWith({
  String? betza,
  List<MoveDefinition>? moves,
  bool? royal,
  PiecePromoOptions? promoOptions,
  bool? enPassantable,
  bool? noSanSymbol,
  int? value,
  List<RegionEffect>? regionEffects,
  List<Action>? actions,
  PieceOptimisationData? optimisationData,
}) =>
    PieceType(
      betza: betza ?? this.betza,
      moves: moves ?? this.moves,
      royal: royal ?? this.royal,
      promoOptions: promoOptions ?? this.promoOptions,
      enPassantable: enPassantable ?? this.enPassantable,
      noSanSymbol: noSanSymbol ?? this.noSanSymbol,
      value: value ?? this.value,
      regionEffects: regionEffects ?? this.regionEffects,
      actions: actions ?? this.actions,
      optimisationData: optimisationData ?? this.optimisationData,
    );