copyWith method

BuiltVariant copyWith({
  1. Variant? data,
  2. List<PieceDefinition>? pieces,
  3. Map<String, PieceDefinition>? pieceLookup,
  4. Map<String, int>? pieceIndexLookup,
  5. List<int>? promotionPieces,
  6. List<int>? promotablePieces,
  7. Map<int, int>? promoLimits,
  8. Map<int, List<int>>? promoMap,
  9. PromotionBuilder? promotionBuilder,
  10. DropBuilderFunction? dropBuilder,
  11. MoveChecker? passChecker,
  12. PieceMoveChecker? firstMoveChecker,
  13. int? royalPiece,
  14. int? epPiece,
  15. int? castlingPiece,
  16. int? rookPiece,
  17. MaterialConditions<int>? materialConditions,
  18. Map<String, BuiltRegion>? regions,
  19. Map<int, List<String>>? winRegions,
  20. List<Action>? actions,
  21. Map<ActionEvent, List<Action>>? actionsByEvent,
  22. StateTransformFunction<BishopState>? stateTransformer,
  23. List<MoveGenFunction<Move>>? moveGenerators,
  24. Map<Type, MoveProcessorFunction<Move>>? moveProcessors,
  25. Map<Type, MoveFormatterFunction<Move>>? algebraicMoveFormatters,
  26. Map<Type, MoveFormatterFunction<Move>>? prettyMoveFormatters,
})

Implementation

BuiltVariant copyWith({
  Variant? data,
  List<PieceDefinition>? pieces,
  Map<String, PieceDefinition>? pieceLookup,
  Map<String, int>? pieceIndexLookup,
  List<int>? promotionPieces,
  List<int>? promotablePieces,
  Map<int, int>? promoLimits,
  Map<int, List<int>>? promoMap,
  PromotionBuilder? promotionBuilder,
  DropBuilderFunction? dropBuilder,
  MoveChecker? passChecker,
  PieceMoveChecker? firstMoveChecker,
  int? royalPiece,
  int? epPiece,
  int? castlingPiece,
  int? rookPiece,
  MaterialConditions<int>? materialConditions,
  Map<String, BuiltRegion>? regions,
  Map<int, List<String>>? winRegions,
  List<Action>? actions,
  Map<ActionEvent, List<Action>>? actionsByEvent,
  StateTransformFunction? stateTransformer,
  List<MoveGenFunction>? moveGenerators,
  Map<Type, MoveProcessorFunction>? moveProcessors,
  Map<Type, MoveFormatterFunction>? algebraicMoveFormatters,
  Map<Type, MoveFormatterFunction>? prettyMoveFormatters,
}) =>
    BuiltVariant(
      data: data ?? this.data,
      pieces: pieces ?? this.pieces,
      pieceLookup: pieceLookup ?? this.pieceLookup,
      pieceIndexLookup: pieceIndexLookup ?? this.pieceIndexLookup,
      promotionPieces: promotionPieces ?? this.promotionPieces,
      promotablePieces: promotablePieces ?? this.promotablePieces,
      promoLimits: promoLimits ?? this.promoLimits,
      promoMap: promoMap ?? this.promoMap,
      promotionBuilder: promotionBuilder ?? this.promotionBuilder,
      dropBuilder: dropBuilder ?? this.dropBuilder,
      passChecker: passChecker ?? this.passChecker,
      firstMoveChecker: firstMoveChecker ?? this.firstMoveChecker,
      royalPiece: royalPiece ?? this.royalPiece,
      epPiece: epPiece ?? this.epPiece,
      castlingPiece: castlingPiece ?? this.castlingPiece,
      rookPiece: rookPiece ?? this.rookPiece,
      materialConditions: materialConditions ?? this.materialConditions,
      regions: regions ?? this.regions,
      winRegions: winRegions ?? this.winRegions,
      actions: actions ?? this.actions,
      actionsByEvent: actionsByEvent ?? this.actionsByEvent,
      stateTransformer: stateTransformer ?? this.stateTransformer,
      moveGenerators: moveGenerators ?? this.moveGenerators,
      moveProcessors: moveProcessors ?? this.moveProcessors,
      algebraicMoveFormatters:
          algebraicMoveFormatters ?? this.algebraicMoveFormatters,
      prettyMoveFormatters: prettyMoveFormatters ?? this.prettyMoveFormatters,
    );