Hook.poolCompatible
This commit is contained in:
parent
1a7789770f
commit
eedf38bf69
|
@ -70,8 +70,13 @@ case class Hook(
|
|||
|
||||
lazy val perfType = PerfPicker.perfType(speed, realVariant, none)
|
||||
|
||||
def likePoolFiveO =
|
||||
realMode.rated && realVariant.standard && color == "random" && clock.show == "5+0"
|
||||
def randomColor = color == "random"
|
||||
|
||||
def poolCompatible =
|
||||
realMode.rated && realVariant.standard && randomColor &&
|
||||
lila.pool.PoolList.clockStringSet.contains(clock.show)
|
||||
|
||||
def likePoolFiveO = poolCompatible && clock.show == "5+0"
|
||||
|
||||
private lazy val speed = Speed(clock.some)
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package lila.pool
|
|||
|
||||
import scala.concurrent.duration._
|
||||
|
||||
private object PoolList {
|
||||
object PoolList {
|
||||
|
||||
import PoolConfig._
|
||||
|
||||
|
@ -17,6 +17,8 @@ private object PoolList {
|
|||
PoolConfig(15 ++ 15, Wave(60 seconds, 16 players))
|
||||
)
|
||||
|
||||
val clockStringSet: Set[String] = all.map(_.clock.show).toSet
|
||||
|
||||
private implicit class PimpedInt(self: Int) {
|
||||
def ++(increment: Int) = chess.Clock(self * 60, increment)
|
||||
def players = NbPlayers(self)
|
||||
|
|
Loading…
Reference in a new issue