Merge pull request #9980 from benediktwerner/tournament-fromPosition-startingPly
Fix swiss&tournament starting ply in FromPositionpull/9985/head
commit
f54d0effe2
|
@ -83,20 +83,15 @@ final private class SwissDirector(
|
|||
): Game =
|
||||
Game
|
||||
.make(
|
||||
chess = chess.Game(
|
||||
variantOption = Some {
|
||||
if (swiss.settings.position.isEmpty) swiss.variant
|
||||
else chess.variant.FromPosition
|
||||
},
|
||||
fen = swiss.settings.position
|
||||
) pipe { g =>
|
||||
val turns = g.player.fold(0, 1)
|
||||
g.copy(
|
||||
clock = swiss.clock.toClock.some,
|
||||
turns = turns,
|
||||
startedAtTurn = turns
|
||||
chess = chess
|
||||
.Game(
|
||||
variantOption = Some {
|
||||
if (swiss.settings.position.isEmpty) swiss.variant
|
||||
else chess.variant.FromPosition
|
||||
},
|
||||
fen = swiss.settings.position
|
||||
)
|
||||
},
|
||||
.copy(clock = swiss.clock.toClock.some),
|
||||
whitePlayer = makePlayer(White, players get pairing.white err s"Missing pairing white $pairing"),
|
||||
blackPlayer = makePlayer(Black, players get pairing.black err s"Missing pairing black $pairing"),
|
||||
mode = chess.Mode(swiss.settings.rated),
|
||||
|
|
|
@ -24,20 +24,15 @@ final class AutoPairing(
|
|||
val clock = tour.clock.toClock
|
||||
val game = Game
|
||||
.make(
|
||||
chess = chess.Game(
|
||||
variantOption = Some {
|
||||
if (tour.position.isEmpty) tour.variant
|
||||
else chess.variant.FromPosition
|
||||
},
|
||||
fen = tour.position
|
||||
) pipe { g =>
|
||||
val turns = g.player.fold(0, 1)
|
||||
g.copy(
|
||||
clock = clock.some,
|
||||
turns = turns,
|
||||
startedAtTurn = turns
|
||||
chess = chess
|
||||
.Game(
|
||||
variantOption = Some {
|
||||
if (tour.position.isEmpty) tour.variant
|
||||
else chess.variant.FromPosition
|
||||
},
|
||||
fen = tour.position
|
||||
)
|
||||
},
|
||||
.copy(clock = clock.some),
|
||||
whitePlayer = makePlayer(White, player1),
|
||||
blackPlayer = makePlayer(Black, player2),
|
||||
mode = tour.mode,
|
||||
|
|
Loading…
Reference in New Issue