From 3136b76c6364fd586be53e27f2532bbdd4f79a53 Mon Sep 17 00:00:00 2001 From: Joffrey Bion Date: Wed, 27 May 2020 20:51:34 +0200 Subject: Rename discardHand to clearHand for clarity --- sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/Game.kt | 2 +- sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/Hands.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sw-engine') 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) = 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>) { return hands[playerIndex] } - fun discardHand(playerIndex: Int): Hands { + fun clearHand(playerIndex: Int): Hands { val mutatedHands = hands.toMutableList() mutatedHands[playerIndex] = emptyList() return Hands(mutatedHands) -- cgit