diff options
author | joffrey-bion <joffrey.bion@gmail.com> | 2021-02-02 14:53:24 +0100 |
---|---|---|
committer | joffrey-bion <joffrey.bion@gmail.com> | 2021-02-02 14:53:24 +0100 |
commit | a91939036b7f69bcb0bfc17d83c69025ad564a07 (patch) | |
tree | d49a19b1efc1791330da3ff95b781f558e7a3cf6 /sw-engine | |
parent | Filter only affordable transactions (diff) | |
download | seven-wonders-a91939036b7f69bcb0bfc17d83c69025ad564a07.tar.gz seven-wonders-a91939036b7f69bcb0bfc17d83c69025ad564a07.tar.bz2 seven-wonders-a91939036b7f69bcb0bfc17d83c69025ad564a07.zip |
Cleanup
Diffstat (limited to 'sw-engine')
-rw-r--r-- | sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/Requirements.kt | 3 | ||||
-rw-r--r-- | sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/RequirementsSatisfaction.kt | 4 |
2 files changed, 3 insertions, 4 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()) |