No systematic renumbering!
This commit is contained in:
@@ -60,9 +60,6 @@ object PairingHandler: PairgothApiHandler {
|
|||||||
}
|
}
|
||||||
val games = tournament.pair(round, pairables)
|
val games = tournament.pair(round, pairables)
|
||||||
|
|
||||||
// always renumber table to take table exclusion into account
|
|
||||||
tournament.renumberTables(round)
|
|
||||||
|
|
||||||
val ret = games.map { it.toJson() }.toJsonArray()
|
val ret = games.map { it.toJson() }.toJsonArray()
|
||||||
tournament.dispatchEvent(GamesAdded, request, Json.Object("round" to round, "games" to ret))
|
tournament.dispatchEvent(GamesAdded, request, Json.Object("round" to round, "games" to ret))
|
||||||
return ret
|
return ret
|
||||||
|
@@ -114,11 +114,17 @@ sealed class Tournament <P: Pairable>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun usedTables(round: Int): BitSet =
|
fun usedTables(round: Int): BitSet {
|
||||||
games(round).values.map { it.table }.fold(BitSet()) { acc, table ->
|
val assigned = games(round).values.map { it.table }.fold(BitSet()) { acc, table ->
|
||||||
acc.set(table)
|
acc.set(table)
|
||||||
acc
|
acc
|
||||||
}
|
}
|
||||||
|
val excluded = excludedTables(round)
|
||||||
|
for (table in excluded) {
|
||||||
|
assigned.set(table)
|
||||||
|
}
|
||||||
|
return assigned
|
||||||
|
}
|
||||||
|
|
||||||
private fun defaultGameOrderBy(game: Game): Int {
|
private fun defaultGameOrderBy(game: Game): Int {
|
||||||
val whiteRank = pairables[game.white]?.rating ?: Int.MIN_VALUE
|
val whiteRank = pairables[game.white]?.rating ?: Int.MIN_VALUE
|
||||||
|
Reference in New Issue
Block a user