summaryrefslogtreecommitdiff
path: root/sw-engine/src/main/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'sw-engine/src/main/kotlin')
-rw-r--r--sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/Cards.kt8
-rw-r--r--sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/wonders/Wonder.kt6
2 files changed, 8 insertions, 6 deletions
diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/Cards.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/Cards.kt
index 438798bf..d5468283 100644
--- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/Cards.kt
+++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/cards/Cards.kt
@@ -21,7 +21,7 @@ internal data class Card(
val back: CardBack,
) {
fun computePlayabilityBy(player: Player, forceSpecialFree: Boolean = false): CardPlayability = when {
- isAlreadyOnBoard(player.board) -> Playability.incompatibleWithBoard() // cannot play twice the same card
+ isAlreadyOnBoard(player.board) -> Playability.alreadyPlayed() // cannot play twice the same card
forceSpecialFree -> Playability.specialFree()
isParentOnBoard(player.board) -> Playability.chainable()
else -> Playability.requirementDependent(requirements.assess(player))
@@ -46,8 +46,10 @@ internal data class Card(
private object Playability {
- fun incompatibleWithBoard(): CardPlayability =
- CardPlayability(isPlayable = false, playabilityLevel = PlayabilityLevel.INCOMPATIBLE_WITH_BOARD)
+ fun alreadyPlayed(): CardPlayability = CardPlayability(
+ isPlayable = false,
+ playabilityLevel = PlayabilityLevel.ALREADY_PLAYED,
+ )
fun chainable(): CardPlayability = CardPlayability(
isPlayable = true,
diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/wonders/Wonder.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/wonders/Wonder.kt
index 81c23160..4a99b9e9 100644
--- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/wonders/Wonder.kt
+++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/wonders/Wonder.kt
@@ -31,7 +31,7 @@ internal class Wonder(
fun computeBuildabilityBy(player: Player): WonderBuildability {
if (nbBuiltStages == stages.size) {
- return Buildability.alreadyBuilt()
+ return Buildability.wonderFullyBuilt()
}
return Buildability.requirementDependent(nextStage.requirements.assess(player))
}
@@ -50,11 +50,11 @@ internal class Wonder(
private object Buildability {
- fun alreadyBuilt() = WonderBuildability(
+ fun wonderFullyBuilt() = WonderBuildability(
isBuildable = false,
minPrice = Int.MAX_VALUE,
cheapestTransactions = emptySet(),
- playabilityLevel = PlayabilityLevel.INCOMPATIBLE_WITH_BOARD,
+ playabilityLevel = PlayabilityLevel.WONDER_FULLY_BUILT,
)
fun requirementDependent(satisfaction: RequirementsSatisfaction) = WonderBuildability(
bgstack15