Do not count preliminary players in round stats

This commit is contained in:
Claude Brisson
2024-07-13 12:53:47 +02:00
parent d7952fcf94
commit 734727c2af

View File

@@ -143,7 +143,7 @@ sealed class Tournament <P: Pairable>(
fun stats() = (0..rounds - 1).map { index ->
Json.Object(
"participants" to pairables.values.count { !it.skip.contains(index + 1) },
"participants" to pairables.values.count { it.final && !it.skip.contains(index + 1) },
"paired" to (games.getOrNull(index)?.values?.flatMap { listOf(it.black, it.white) }?.count { it != 0 } ?: 0),
"games" to (games.getOrNull(index)?.values?.count() ?: 0),
"ready" to (games.getOrNull(index)?.values?.count { it.result != Game.Result.UNKNOWN } ?: 0)