diff options
author | Joffrey Bion <joffrey.bion@booking.com> | 2020-05-27 20:51:34 +0200 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@booking.com> | 2020-05-27 20:51:44 +0200 |
commit | 3136b76c6364fd586be53e27f2532bbdd4f79a53 (patch) | |
tree | ec92f97e093840ff31441a611957895303bcd63a | |
parent | Remove ugly emoji from README (diff) | |
download | seven-wonders-3136b76c6364fd586be53e27f2532bbdd4f79a53.tar.gz seven-wonders-3136b76c6364fd586be53e27f2532bbdd4f79a53.tar.bz2 seven-wonders-3136b76c6364fd586be53e27f2532bbdd4f79a53.zip |
Rename discardHand to clearHand for clarity
-rw-r--r-- | sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/Game.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/Game.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/Game.kt index 8a5c1d93..f7c29214 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/Game.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/Game.kt @@ -193,7 +193,7 @@ class Game internal constructor( private fun discardHand(playerIndex: Int) { val hand = hands[playerIndex] discardedCards.addAll(hand) - hands = hands.discardHand(playerIndex) + hands = hands.clearHand(playerIndex) } private fun activatePlayedCards(playedMoves: List<Move>) = 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 9f73cd67..f1f49cd8 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 @@ -13,7 +13,7 @@ internal class Hands(private val hands: List<List<Card>>) { return hands[playerIndex] } - fun discardHand(playerIndex: Int): Hands { + fun clearHand(playerIndex: Int): Hands { val mutatedHands = hands.toMutableList() mutatedHands[playerIndex] = emptyList() return Hands(mutatedHands) |