get rid of tournament swiss system until tournament rewrite is complete
This commit is contained in:
parent
e90024a41c
commit
2c2ec63469
|
@ -29,7 +29,6 @@ object Tournament extends LilaController {
|
|||
def help(sysStr: Option[String]) = Open { implicit ctx =>
|
||||
val system = sysStr flatMap {
|
||||
case "arena" => System.Arena.some
|
||||
case "swiss" => System.Swiss.some
|
||||
case _ => none
|
||||
}
|
||||
Ok(html.tournament.faqPage(system)).fuccess
|
||||
|
|
|
@ -30,8 +30,7 @@ trait SetupHelper { self: I18nHelper =>
|
|||
)
|
||||
|
||||
def translatedSystemChoices(implicit ctx: Context) = List(
|
||||
System.Arena.id.toString -> "Arena",
|
||||
System.Swiss.id.toString -> "Swiss [beta]"
|
||||
System.Arena.id.toString -> "Arena"
|
||||
)
|
||||
|
||||
private def variantTuple(variant: chess.variant.Variant)(implicit ctx: Context): (String, String, Option[String]) =
|
||||
|
|
|
@ -55,7 +55,6 @@ trait TournamentHelper { self: I18nHelper =>
|
|||
|
||||
def systemName(sys: System)(implicit ctx: UserContext) = sys match {
|
||||
case System.Arena => System.Arena.toString
|
||||
case System.Swiss => System.Swiss.toString
|
||||
}
|
||||
|
||||
def tournamentIconChar(tour: Tournament): Char = tour.schedule.map(_.freq) match {
|
||||
|
|
|
@ -40,22 +40,10 @@
|
|||
<br />
|
||||
<em>Berserk</em> is not available when the clock has an increment (like 0+1 or 5+2).
|
||||
}
|
||||
case Some(System.Swiss) => {
|
||||
A win is worth 1 point, a draw: ½ point, and a loss is worth no points. If at
|
||||
a given round there are an odd number of players, the player which does not get
|
||||
assigned a pairing receives a bye. A bye is worth as much as a victory.
|
||||
<br />
|
||||
To break ties, an additional score is computed as the sum of the scores of
|
||||
defeated opponents plus half of the sum of the scores of drawn opponents. This
|
||||
tie-breaker, called the Neustadtl or Sonnenborn-Berger score, is indicated in
|
||||
parentheses next to the standard score.
|
||||
}
|
||||
case _ => {
|
||||
How scores are calculated depends on the system used for the tournament. In
|
||||
all cases a win is worth twice as much as a draw, and a loss is worth no
|
||||
points. In the Arena system, winning games in succession yields an additional
|
||||
bonus. In the Swiss system, winning against stronger opponents helps in tie
|
||||
breaks.
|
||||
points. In the Arena system, winning games in succession yields an additional bonus.
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,13 +60,6 @@
|
|||
however you may not face all other players in the tournament.
|
||||
Play fast and return to the lobby to play more games and win more points.
|
||||
}
|
||||
case Some(System.Swiss) => {
|
||||
Pairings are generated on a round basis, meaning everyone plays the same
|
||||
number of games. Players with equal scores in the tournament are paired
|
||||
together to the extent possible. Two players can play against each other at
|
||||
most once in the tournament. The system additionally ensures that each player
|
||||
plays approximately as often as white and as black.
|
||||
}
|
||||
case _ => {
|
||||
The pairing mechanism depends on the system used for the tournament. In the
|
||||
Arena system, new pairings are generated as soon as enough players are
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
@side = {
|
||||
<div class="tournament_links">
|
||||
<a href="@routes.Tournament.help("arena".some)">Arena tournament help</a>
|
||||
*<a href="@routes.Tournament.help("swiss".some)">Swiss tournament help</a>*
|
||||
<a href="@routes.Tournament.home()">Return to tournaments</a>
|
||||
</div>
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
@side = {
|
||||
<div class="tournament_links">
|
||||
<a href="@routes.Tournament.help("arena".some)">Arena tournament help</a>
|
||||
<a href="@routes.Tournament.help("swiss".some)">Swiss tournament help</a>
|
||||
</div>
|
||||
<h2 class="leaderboard_title">@trans.leaderboard()</h2>
|
||||
<ol class="tournament_leaderboard">
|
||||
|
|
|
@ -96,7 +96,6 @@ trait Positional { self: Config =>
|
|||
object Config extends BaseConfig
|
||||
|
||||
trait BaseConfig {
|
||||
// val systems = List(TournamentSystem.Arena.id, TournamentSystem.Swiss.id)
|
||||
val systems = List(TournamentSystem.Arena.id)
|
||||
val systemDefault = TournamentSystem.default
|
||||
|
||||
|
|
|
@ -43,8 +43,6 @@ final class DataForm {
|
|||
"clockIncrement" -> numberIn(clockIncrementPrivateChoices),
|
||||
"minutes" -> numberIn(minutePrivateChoices),
|
||||
"waitMinutes" -> numberIn(waitMinuteChoices),
|
||||
// "system" -> number.verifying(Set(System.Arena.id, System.Swiss.id) contains _),
|
||||
"system" -> number.verifying(Set(System.Arena.id) contains _),
|
||||
"variant" -> number.verifying(Set(chess.variant.Standard.id, chess.variant.Chess960.id, chess.variant.KingOfTheHill.id,
|
||||
chess.variant.ThreeCheck.id, chess.variant.Antichess.id, chess.variant.Atomic.id, chess.variant.Horde.id) contains _),
|
||||
"position" -> nonEmptyText.verifying(positions contains _),
|
||||
|
@ -58,7 +56,6 @@ final class DataForm {
|
|||
clockIncrement = clockIncrementDefault,
|
||||
minutes = minuteDefault,
|
||||
waitMinutes = waitMinuteDefault,
|
||||
system = System.default.id,
|
||||
variant = chess.variant.Standard.id,
|
||||
position = StartingPosition.initial.eco,
|
||||
`private` = None,
|
||||
|
@ -70,7 +67,6 @@ private[tournament] case class TournamentSetup(
|
|||
clockIncrement: Int,
|
||||
minutes: Int,
|
||||
waitMinutes: Int,
|
||||
system: Int,
|
||||
variant: Int,
|
||||
position: String,
|
||||
mode: Option[Int],
|
||||
|
|
|
@ -74,10 +74,6 @@ final class JsonView(
|
|||
"total" -> s.total,
|
||||
"fire" -> s.onFire.option(true)
|
||||
).noNull
|
||||
// case s: swiss.SwissSystem.Sheet => Json.obj(
|
||||
// "scores" -> s.scores.take(18).reverse.map(_.repr),
|
||||
// "total" -> s.totalRepr,
|
||||
// "neustadtl" -> s.neustadtlRepr)
|
||||
}
|
||||
|
||||
private def playerJson(sheets: Map[String, ScoreSheet], tour: Tournament)(rankedPlayer: RankedPlayer) = {
|
||||
|
|
|
@ -13,15 +13,8 @@ object System {
|
|||
val berserkable = true
|
||||
}
|
||||
|
||||
// case object Swiss extends System(id = 2) {
|
||||
// val pairingSystem = swiss.SwissSystem
|
||||
// val scoringSystem = swiss.SwissSystem
|
||||
// val berserkable = false
|
||||
// }
|
||||
|
||||
val default = Arena
|
||||
|
||||
// val all = List(Arena, Swiss)
|
||||
val all = List(Arena)
|
||||
|
||||
val byId = all map { s => (s.id -> s) } toMap
|
||||
|
|
|
@ -45,7 +45,7 @@ private[tournament] final class TournamentApi(
|
|||
waitMinutes = setup.waitMinutes,
|
||||
mode = setup.mode.fold(Mode.default)(Mode.orDefault),
|
||||
`private` = setup.`private`.isDefined,
|
||||
system = System orDefault setup.system,
|
||||
system = System.Arena,
|
||||
variant = variant,
|
||||
position = StartingPosition.byEco(setup.position).ifTrue(variant.standard) | StartingPosition.initial)
|
||||
TournamentRepo.insert(tour).void >>
|
||||
|
|
Loading…
Reference in a new issue