copyWith method

StandardMove copyWith({
  1. int? from,
  2. int? to,
  3. int? capturedPiece,
  4. int? promoSource,
  5. int? promoPiece,
  6. CastlingRights? castlingDir,
  7. int? castlingPieceSquare,
  8. bool? enPassant,
  9. bool? setEnPassant,
})

Implementation

StandardMove copyWith({
  int? from,
  int? to,
  int? capturedPiece,
  int? promoSource,
  int? promoPiece,
  CastlingRights? castlingDir,
  int? castlingPieceSquare,
  bool? enPassant,
  bool? setEnPassant,
}) {
  return StandardMove(
    from: from ?? this.from,
    to: to ?? this.to,
    capturedPiece: capturedPiece ?? this.capturedPiece,
    promoSource: promoSource ?? this.promoSource,
    promoPiece: promoPiece ?? this.promoPiece,
    castlingDir: castlingDir ?? this.castlingDir,
    castlingPieceSquare: castlingPieceSquare ?? this.castlingPieceSquare,
    enPassant: enPassant ?? this.enPassant,
    setEnPassant: setEnPassant ?? this.setEnPassant,
  );
}