diff options
author | Joffrey Bion <joffrey.bion@gmail.com> | 2022-07-03 00:18:46 +0200 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@gmail.com> | 2022-07-03 00:20:01 +0200 |
commit | 6640170c01ccf5c7de8c0893379c1b500f9e9fb1 (patch) | |
tree | 1b8b712a5ecf4fd7baf62f0c4a9b8399db1bcad7 /sw-common-model/src | |
parent | Upgrade Spring boot to 2.7.1 (diff) | |
download | seven-wonders-6640170c01ccf5c7de8c0893379c1b500f9e9fb1.tar.gz seven-wonders-6640170c01ccf5c7de8c0893379c1b500f9e9fb1.tar.bz2 seven-wonders-6640170c01ccf5c7de8c0893379c1b500f9e9fb1.zip |
Upgrade to Kotlin 1.7
Diffstat (limited to 'sw-common-model/src')
-rw-r--r-- | sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/score/Score.kt | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/score/Score.kt b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/score/Score.kt index 9b0c5fb6..36ed1ca2 100644 --- a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/score/Score.kt +++ b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/score/Score.kt @@ -8,9 +8,8 @@ data class ScoreBoard(val scores: List<PlayerScore>) { require(scores.sortedDescending() == scores) { "Scores must be sorted highest-to-lowest" } } - @OptIn(ExperimentalStdlibApi::class) val ranks: List<Int> - get() = buildList<Int> { + get() = buildList { add(1) scores.zipWithNext { prev, current -> current.compareTo(prev) == 0 }.forEach { exAequoWithPrev -> add(if (exAequoWithPrev) last() else size + 1) |