Chess.fromSetup constructor
Sets up a playable Chess position.
Throws a PositionSetupException if the Setup does not meet basic validity
requirements.
Optionnaly pass ignoreImpossibleCheck if you want to skip that requirement.
Implementation
factory Chess.fromSetup(Setup setup, {bool? ignoreImpossibleCheck}) {
final pos = Chess(
board: setup.board,
pockets: setup.pockets,
turn: setup.turn,
castles: Castles.fromSetup(setup),
epSquare: _validEpSquare(setup),
halfmoves: setup.halfmoves,
fullmoves: setup.fullmoves,
);
pos.validate(ignoreImpossibleCheck: ignoreImpossibleCheck);
return pos;
}