diff options
author | joffrey-bion <joffrey.bion@gmail.com> | 2020-11-27 02:14:39 +0100 |
---|---|---|
committer | joffrey-bion <joffrey.bion@gmail.com> | 2020-11-27 03:09:19 +0100 |
commit | cf29a354b480b9cb027909ac41b4972ba4bc6293 (patch) | |
tree | d095bec36174a1a0efb11f7eae87ba3b8c3d7c3f /sw-engine | |
parent | Support ex-aequo ranks (diff) | |
download | seven-wonders-cf29a354b480b9cb027909ac41b4972ba4bc6293.tar.gz seven-wonders-cf29a354b480b9cb027909ac41b4972ba4bc6293.tar.bz2 seven-wonders-cf29a354b480b9cb027909ac41b4972ba4bc6293.zip |
Switch max/min to maxOrNull/minOrNull
Diffstat (limited to 'sw-engine')
-rw-r--r-- | sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/boards/Science.kt | 2 | ||||
-rw-r--r-- | sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/Hands.kt | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/boards/Science.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/boards/Science.kt index 992f4079..681f1c27 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/boards/Science.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/boards/Science.kt @@ -50,7 +50,7 @@ internal class Science { private fun computePointsNoJoker(values: List<Int>): Int { val independentSquaresSum = values.sumBy { it * it } - val nbGroupsOfAll = values.min() ?: 0 + val nbGroupsOfAll = values.minOrNull() ?: 0 return independentSquaresSum + nbGroupsOfAll * 7 } } diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/Hands.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/Hands.kt index b024848d..9bb1e6f8 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/Hands.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/Hands.kt @@ -35,5 +35,5 @@ internal class Hands(private val hands: List<List<Card>>) { return Hands(newHands) } - fun maxOneCardRemains(): Boolean = hands.map { it.size }.max() ?: 0 <= 1 + fun maxOneCardRemains(): Boolean = hands.map { it.size }.maxOrNull() ?: 0 <= 1 } |