summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/Requirements.kt3
-rw-r--r--sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/RequirementsSatisfaction.kt4
-rw-r--r--sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/Hand.kt2
3 files changed, 4 insertions, 5 deletions
diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/Requirements.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/Requirements.kt
index 4872f44f..5966ced5 100644
--- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/Requirements.kt
+++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/Requirements.kt
@@ -6,7 +6,6 @@ import org.luxons.sevenwonders.engine.boards.Board
import org.luxons.sevenwonders.engine.resources.*
import org.luxons.sevenwonders.model.resources.ResourceTransactions
import org.luxons.sevenwonders.model.resources.bestPrice
-import org.luxons.sevenwonders.model.resources.noTransactionOptions
import org.luxons.sevenwonders.model.resources.totalPrice
@Serializable
@@ -44,7 +43,7 @@ data class Requirements internal constructor(
}
val minPrice = allOptions.bestPrice + gold
if (minPrice > player.board.gold) {
- return RequirementsSatisfaction.missingGoldForResources(minPrice, noTransactionOptions())
+ return RequirementsSatisfaction.missingGoldForResources(minPrice)
}
val availableOptions = allOptions.filter { it.totalPrice + gold <= player.board.gold }
return RequirementsSatisfaction.metWithHelp(minPrice, availableOptions)
diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/RequirementsSatisfaction.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/RequirementsSatisfaction.kt
index 55ec1edb..5f5db0db 100644
--- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/RequirementsSatisfaction.kt
+++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/RequirementsSatisfaction.kt
@@ -31,8 +31,8 @@ internal data class RequirementsSatisfaction(
internal fun missingRequiredGold(minPrice: Int) =
RequirementsSatisfaction(false, PlayabilityLevel.MISSING_REQUIRED_GOLD, minPrice, noTransactionOptions())
- internal fun missingGoldForResources(minPrice: Int, transactionOptions: ResourceTransactionOptions) =
- RequirementsSatisfaction(false, PlayabilityLevel.MISSING_GOLD_FOR_RES, minPrice, transactionOptions)
+ internal fun missingGoldForResources(minPrice: Int) =
+ RequirementsSatisfaction(false, PlayabilityLevel.MISSING_GOLD_FOR_RES, minPrice, noTransactionOptions())
internal fun unavailableResources() =
RequirementsSatisfaction(false, PlayabilityLevel.UNAVAILABLE_RESOURCES, Int.MAX_VALUE, noTransactionOptions())
diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/Hand.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/Hand.kt
index a5ce0357..59ab12ce 100644
--- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/Hand.kt
+++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/Hand.kt
@@ -147,7 +147,7 @@ class HandComponent(props: HandProps) : RComponent<HandProps, RState>(props) {
private fun prepareMove(moveType: MoveType, card: HandCard, transactionOptions: ResourceTransactionOptions) {
when (transactionOptions.size) {
- 1 -> props.prepareMove(PlayerMove(moveType, card.name, transactionOptions.first()))
+ 1 -> props.prepareMove(PlayerMove(moveType, card.name, transactionOptions.single()))
else -> props.startTransactionsSelection(TransactionSelectorState(moveType, card, transactionOptions))
}
}
bgstack15