use clock configs in pools

This commit is contained in:
Thibault Duplessis 2016-12-05 17:54:31 +01:00
parent fbe25f5370
commit 1dd66f9bc6
3 changed files with 4 additions and 4 deletions

View file

@ -59,7 +59,7 @@ private final class GameStarter(
blackUser: (User.ID, Perf)) = Game.make(
game = chess.Game(
board = chess.Board init chess.variant.Standard,
clock = pool.clock.some),
clock = pool.clock.toClock.some),
whitePlayer = Player.white.withUser(whiteUser._1, whiteUser._2),
blackPlayer = Player.black.withUser(blackUser._1, blackUser._2),
mode = chess.Mode.Rated,

View file

@ -6,7 +6,7 @@ import chess.Clock
import lila.rating.PerfType
case class PoolConfig(
clock: chess.Clock,
clock: chess.Clock.Config,
wave: PoolConfig.Wave) {
val perfType = PerfType(chess.Speed(clock).key) | PerfType.Classical
@ -21,5 +21,5 @@ object PoolConfig {
case class Wave(every: FiniteDuration, players: NbPlayers)
def clockToId(clock: Clock) = Id(clock.show)
def clockToId(clock: chess.Clock.Config) = Id(clock.show)
}

View file

@ -20,7 +20,7 @@ object PoolList {
val clockStringSet: Set[String] = all.map(_.clock.show).toSet
private implicit class PimpedInt(self: Int) {
def ++(increment: Int) = chess.Clock(self * 60, increment)
def ++(increment: Int) = chess.Clock.Config(self * 60, increment)
def players = NbPlayers(self)
}
}