diff options
author | Joffrey BION <joffrey.bion@gmail.com> | 2019-05-22 01:41:08 +0200 |
---|---|---|
committer | Joffrey BION <joffrey.bion@gmail.com> | 2019-05-22 01:41:08 +0200 |
commit | 2428a88a5400ca9aa5465beb5ecf06491acad3c7 (patch) | |
tree | b35371d87a12b6247e15073dcf6f59c4ab7bcda7 /sw-engine/src/main/kotlin | |
parent | Comment plugin management related to unused multiplatform plugin (diff) | |
download | seven-wonders-2428a88a5400ca9aa5465beb5ecf06491acad3c7.tar.gz seven-wonders-2428a88a5400ca9aa5465beb5ecf06491acad3c7.tar.bz2 seven-wonders-2428a88a5400ca9aa5465beb5ecf06491acad3c7.zip |
Move common module declarations into api package
Diffstat (limited to 'sw-engine/src/main/kotlin')
29 files changed, 108 insertions, 71 deletions
diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/Game.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/Game.kt index 70198f15..b8866e9f 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/Game.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/Game.kt @@ -1,7 +1,7 @@ package org.luxons.sevenwonders.game import org.luxons.sevenwonders.game.api.Action -import org.luxons.sevenwonders.game.cards.HandCard +import org.luxons.sevenwonders.game.api.cards.HandCard import org.luxons.sevenwonders.game.api.PlayerMove import org.luxons.sevenwonders.game.api.PlayerTurnInfo import org.luxons.sevenwonders.game.api.toApiTable @@ -10,7 +10,7 @@ import org.luxons.sevenwonders.game.api.toTableCard import org.luxons.sevenwonders.game.boards.Board import org.luxons.sevenwonders.game.boards.Table import org.luxons.sevenwonders.game.cards.Card -import org.luxons.sevenwonders.game.cards.CardBack +import org.luxons.sevenwonders.game.api.cards.CardBack import org.luxons.sevenwonders.game.cards.Decks import org.luxons.sevenwonders.game.cards.Hands import org.luxons.sevenwonders.game.data.LAST_AGE diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/Player.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/Player.kt index 2c82b6ff..877ea530 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/Player.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/Player.kt @@ -1,7 +1,7 @@ package org.luxons.sevenwonders.game import org.luxons.sevenwonders.game.boards.Board -import org.luxons.sevenwonders.game.boards.RelativeBoardPosition +import org.luxons.sevenwonders.game.api.boards.RelativeBoardPosition import org.luxons.sevenwonders.game.boards.Table import org.luxons.sevenwonders.game.cards.Card diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/api/Boards.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/api/Boards.kt index 1fe3295a..60b04318 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/api/Boards.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/api/Boards.kt @@ -1,23 +1,22 @@ package org.luxons.sevenwonders.game.api import org.luxons.sevenwonders.game.Player -import org.luxons.sevenwonders.game.boards.ApiBoard -import org.luxons.sevenwonders.game.boards.ApiMilitary -import org.luxons.sevenwonders.game.boards.ApiProduction -import org.luxons.sevenwonders.game.boards.ApiRequirements -import org.luxons.sevenwonders.game.boards.ApiScience +import org.luxons.sevenwonders.game.api.boards.ApiBoard +import org.luxons.sevenwonders.game.api.boards.ApiMilitary +import org.luxons.sevenwonders.game.api.boards.ApiProduction +import org.luxons.sevenwonders.game.api.boards.ApiRequirements +import org.luxons.sevenwonders.game.api.boards.ApiScience import org.luxons.sevenwonders.game.boards.Military import org.luxons.sevenwonders.game.boards.Science import org.luxons.sevenwonders.game.boards.ScienceType import org.luxons.sevenwonders.game.cards.Requirements -import org.luxons.sevenwonders.game.cards.TableCard +import org.luxons.sevenwonders.game.api.cards.TableCard import org.luxons.sevenwonders.game.moves.Move -import org.luxons.sevenwonders.game.moves.MoveType -import org.luxons.sevenwonders.game.resources.CountedResource +import org.luxons.sevenwonders.game.api.resources.CountedResource import org.luxons.sevenwonders.game.resources.Production import org.luxons.sevenwonders.game.resources.Resources -import org.luxons.sevenwonders.game.wonders.ApiWonder -import org.luxons.sevenwonders.game.wonders.ApiWonderStage +import org.luxons.sevenwonders.game.api.wonders.ApiWonder +import org.luxons.sevenwonders.game.api.wonders.ApiWonderStage import org.luxons.sevenwonders.game.boards.Board as InternalBoard import org.luxons.sevenwonders.game.wonders.Wonder as InternalWonder import org.luxons.sevenwonders.game.wonders.WonderStage as InternalWonderStage diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/api/Cards.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/api/Cards.kt index 7587d69a..9580e3be 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/api/Cards.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/api/Cards.kt @@ -2,8 +2,8 @@ package org.luxons.sevenwonders.game.api import org.luxons.sevenwonders.game.Player import org.luxons.sevenwonders.game.cards.Card -import org.luxons.sevenwonders.game.cards.HandCard -import org.luxons.sevenwonders.game.cards.TableCard +import org.luxons.sevenwonders.game.api.cards.HandCard +import org.luxons.sevenwonders.game.api.cards.TableCard import org.luxons.sevenwonders.game.moves.Move internal fun Card.toTableCard(lastMove: Move? = null): TableCard = diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/boards/Board.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/boards/Board.kt index a43b8a3c..38bae9ea 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/boards/Board.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/boards/Board.kt @@ -4,7 +4,7 @@ import org.luxons.sevenwonders.game.Player import org.luxons.sevenwonders.game.Settings import org.luxons.sevenwonders.game.api.Age import org.luxons.sevenwonders.game.cards.Card -import org.luxons.sevenwonders.game.cards.Color +import org.luxons.sevenwonders.game.api.cards.Color import org.luxons.sevenwonders.game.effects.SpecialAbility import org.luxons.sevenwonders.game.resources.Production import org.luxons.sevenwonders.game.resources.TradingRules diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/boards/Table.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/boards/Table.kt index 168649f4..04b3d104 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/boards/Table.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/boards/Table.kt @@ -1,9 +1,11 @@ package org.luxons.sevenwonders.game.boards import org.luxons.sevenwonders.game.api.Age +import org.luxons.sevenwonders.game.api.boards.RelativeBoardPosition +import org.luxons.sevenwonders.game.api.boards.neighboursPositions import org.luxons.sevenwonders.game.cards.Card -import org.luxons.sevenwonders.game.cards.Color -import org.luxons.sevenwonders.game.cards.HandRotationDirection +import org.luxons.sevenwonders.game.api.cards.Color +import org.luxons.sevenwonders.game.api.cards.HandRotationDirection import org.luxons.sevenwonders.game.moves.Move /** diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/cards/Cards.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/cards/Cards.kt index b983aa0e..b179a2e4 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/cards/Cards.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/cards/Cards.kt @@ -1,10 +1,14 @@ package org.luxons.sevenwonders.game.cards import org.luxons.sevenwonders.game.Player +import org.luxons.sevenwonders.game.api.cards.CardBack +import org.luxons.sevenwonders.game.api.cards.CardPlayability +import org.luxons.sevenwonders.game.api.cards.Color +import org.luxons.sevenwonders.game.api.cards.PlayabilityLevel import org.luxons.sevenwonders.game.boards.Board import org.luxons.sevenwonders.game.effects.Effect -import org.luxons.sevenwonders.game.resources.ResourceTransactions -import org.luxons.sevenwonders.game.resources.noTransactions +import org.luxons.sevenwonders.game.api.resources.ResourceTransactions +import org.luxons.sevenwonders.game.api.resources.noTransactions internal data class Card( val name: String, @@ -41,24 +45,27 @@ internal data class Card( private object Playability { - internal fun incompatibleWithBoard(): CardPlayability = CardPlayability( - isPlayable = false, - playabilityLevel = PlayabilityLevel.INCOMPATIBLE_WITH_BOARD - ) + internal fun incompatibleWithBoard(): CardPlayability = + CardPlayability( + isPlayable = false, + playabilityLevel = PlayabilityLevel.INCOMPATIBLE_WITH_BOARD + ) - internal fun chainable(): CardPlayability = CardPlayability( - isPlayable = true, - isChainable = true, - minPrice = 0, - cheapestTransactions = setOf(noTransactions()), - playabilityLevel = PlayabilityLevel.CHAINABLE - ) + internal fun chainable(): CardPlayability = + CardPlayability( + isPlayable = true, + isChainable = true, + minPrice = 0, + cheapestTransactions = setOf(noTransactions()), + playabilityLevel = PlayabilityLevel.CHAINABLE + ) - internal fun requirementDependent(satisfaction: RequirementsSatisfaction): CardPlayability = CardPlayability( - isPlayable = satisfaction.satisfied, - isChainable = false, - minPrice = satisfaction.minPrice, - cheapestTransactions = satisfaction.cheapestTransactions, - playabilityLevel = satisfaction.level - ) + internal fun requirementDependent(satisfaction: RequirementsSatisfaction): CardPlayability = + CardPlayability( + isPlayable = satisfaction.satisfied, + isChainable = false, + minPrice = satisfaction.minPrice, + cheapestTransactions = satisfaction.cheapestTransactions, + playabilityLevel = satisfaction.level + ) } diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/cards/Hands.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/cards/Hands.kt index 19490b9c..1dc5e5df 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/cards/Hands.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/cards/Hands.kt @@ -1,6 +1,8 @@ package org.luxons.sevenwonders.game.cards import org.luxons.sevenwonders.game.Player +import org.luxons.sevenwonders.game.api.cards.HandCard +import org.luxons.sevenwonders.game.api.cards.HandRotationDirection import org.luxons.sevenwonders.game.api.toHandCard internal class Hands(private val hands: List<List<Card>>) { diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/cards/Requirements.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/cards/Requirements.kt index 27f73109..3cdf8141 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/cards/Requirements.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/cards/Requirements.kt @@ -2,7 +2,7 @@ package org.luxons.sevenwonders.game.cards import org.luxons.sevenwonders.game.Player import org.luxons.sevenwonders.game.boards.Board -import org.luxons.sevenwonders.game.resources.ResourceTransactions +import org.luxons.sevenwonders.game.api.resources.ResourceTransactions import org.luxons.sevenwonders.game.resources.Resources import org.luxons.sevenwonders.game.resources.asResources import org.luxons.sevenwonders.game.resources.bestSolution diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/cards/RequirementsSatisfaction.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/cards/RequirementsSatisfaction.kt index 87b35723..3df2811f 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/cards/RequirementsSatisfaction.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/cards/RequirementsSatisfaction.kt @@ -1,7 +1,8 @@ package org.luxons.sevenwonders.game.cards -import org.luxons.sevenwonders.game.resources.ResourceTransactions -import org.luxons.sevenwonders.game.resources.noTransactions +import org.luxons.sevenwonders.game.api.cards.PlayabilityLevel +import org.luxons.sevenwonders.game.api.resources.ResourceTransactions +import org.luxons.sevenwonders.game.api.resources.noTransactions internal data class RequirementsSatisfaction( val satisfied: Boolean, diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/GameDefinition.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/GameDefinition.kt index 43c48aa7..f682b970 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/GameDefinition.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/GameDefinition.kt @@ -23,7 +23,7 @@ import org.luxons.sevenwonders.game.effects.ProductionIncrease import org.luxons.sevenwonders.game.effects.RawPointsIncrease import org.luxons.sevenwonders.game.effects.ScienceProgress import org.luxons.sevenwonders.game.resources.Production -import org.luxons.sevenwonders.game.resources.ResourceType +import org.luxons.sevenwonders.game.api.resources.ResourceType import org.luxons.sevenwonders.game.resources.Resources internal const val LAST_AGE: Age = 3 diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/definitions/CardDefinition.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/definitions/CardDefinition.kt index 0b7b9229..879c2c68 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/definitions/CardDefinition.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/definitions/CardDefinition.kt @@ -1,8 +1,8 @@ package org.luxons.sevenwonders.game.data.definitions import org.luxons.sevenwonders.game.cards.Card -import org.luxons.sevenwonders.game.cards.CardBack -import org.luxons.sevenwonders.game.cards.Color +import org.luxons.sevenwonders.game.api.cards.CardBack +import org.luxons.sevenwonders.game.api.cards.Color import org.luxons.sevenwonders.game.cards.Requirements internal class CardDefinition( diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/definitions/DecksDefinition.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/definitions/DecksDefinition.kt index b090547d..a4011e84 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/definitions/DecksDefinition.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/definitions/DecksDefinition.kt @@ -1,7 +1,7 @@ package org.luxons.sevenwonders.game.data.definitions import org.luxons.sevenwonders.game.cards.Card -import org.luxons.sevenwonders.game.cards.CardBack +import org.luxons.sevenwonders.game.api.cards.CardBack import org.luxons.sevenwonders.game.cards.Decks import kotlin.random.Random @@ -9,7 +9,10 @@ internal class DeckDefinition( val cards: List<CardDefinition>, val backImage: String ) { - fun create(nbPlayers: Int): List<Card> = cards.flatMap { it.create(CardBack(backImage), nbPlayers) } + fun create(nbPlayers: Int): List<Card> = cards.flatMap { it.create( + CardBack( + backImage + ), nbPlayers) } } internal class DecksDefinition( diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/definitions/WonderDefinition.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/definitions/WonderDefinition.kt index fb0eccda..6b694acc 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/definitions/WonderDefinition.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/definitions/WonderDefinition.kt @@ -2,7 +2,7 @@ package org.luxons.sevenwonders.game.data.definitions import org.luxons.sevenwonders.game.api.WonderSide import org.luxons.sevenwonders.game.cards.Requirements -import org.luxons.sevenwonders.game.resources.ResourceType +import org.luxons.sevenwonders.game.api.resources.ResourceType import org.luxons.sevenwonders.game.wonders.Wonder import org.luxons.sevenwonders.game.wonders.WonderStage diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ProductionSerializer.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ProductionSerializer.kt index b766dd31..9f3c4721 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ProductionSerializer.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ProductionSerializer.kt @@ -8,7 +8,7 @@ import com.google.gson.JsonParseException import com.google.gson.JsonSerializationContext import com.google.gson.JsonSerializer import org.luxons.sevenwonders.game.resources.Production -import org.luxons.sevenwonders.game.resources.ResourceType +import org.luxons.sevenwonders.game.api.resources.ResourceType import org.luxons.sevenwonders.game.resources.Resources import java.lang.reflect.Type diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourceTypeSerializer.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourceTypeSerializer.kt index 99c364c5..37dd2cdb 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourceTypeSerializer.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourceTypeSerializer.kt @@ -7,7 +7,7 @@ import com.google.gson.JsonParseException import com.google.gson.JsonPrimitive import com.google.gson.JsonSerializationContext import com.google.gson.JsonSerializer -import org.luxons.sevenwonders.game.resources.ResourceType +import org.luxons.sevenwonders.game.api.resources.ResourceType import java.lang.reflect.Type internal class ResourceTypeSerializer : JsonSerializer<ResourceType>, JsonDeserializer<ResourceType> { diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourceTypesSerializer.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourceTypesSerializer.kt index b4784689..8dc43af4 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourceTypesSerializer.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourceTypesSerializer.kt @@ -7,7 +7,7 @@ import com.google.gson.JsonParseException import com.google.gson.JsonPrimitive import com.google.gson.JsonSerializationContext import com.google.gson.JsonSerializer -import org.luxons.sevenwonders.game.resources.ResourceType +import org.luxons.sevenwonders.game.api.resources.ResourceType import java.lang.reflect.Type internal class ResourceTypesSerializer : JsonSerializer<List<ResourceType>>, JsonDeserializer<List<ResourceType>> { diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourcesSerializer.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourcesSerializer.kt index 1b1373ed..0d9230d8 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourcesSerializer.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/serializers/ResourcesSerializer.kt @@ -8,7 +8,7 @@ import com.google.gson.JsonParseException import com.google.gson.JsonPrimitive import com.google.gson.JsonSerializationContext import com.google.gson.JsonSerializer -import org.luxons.sevenwonders.game.resources.ResourceType +import org.luxons.sevenwonders.game.api.resources.ResourceType import org.luxons.sevenwonders.game.resources.Resources import org.luxons.sevenwonders.game.resources.toResources import java.lang.reflect.Type diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/effects/BonusPerBoardElement.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/effects/BonusPerBoardElement.kt index 04dbf9be..f16c9f78 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/effects/BonusPerBoardElement.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/effects/BonusPerBoardElement.kt @@ -2,8 +2,8 @@ package org.luxons.sevenwonders.game.effects import org.luxons.sevenwonders.game.Player import org.luxons.sevenwonders.game.boards.Board -import org.luxons.sevenwonders.game.boards.RelativeBoardPosition -import org.luxons.sevenwonders.game.cards.Color +import org.luxons.sevenwonders.game.api.boards.RelativeBoardPosition +import org.luxons.sevenwonders.game.api.cards.Color enum class BoardElementType { CARD, diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/effects/Discount.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/effects/Discount.kt index 981ad9bd..0809d279 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/effects/Discount.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/effects/Discount.kt @@ -1,8 +1,8 @@ package org.luxons.sevenwonders.game.effects import org.luxons.sevenwonders.game.boards.Board -import org.luxons.sevenwonders.game.resources.Provider -import org.luxons.sevenwonders.game.resources.ResourceType +import org.luxons.sevenwonders.game.api.resources.Provider +import org.luxons.sevenwonders.game.api.resources.ResourceType internal data class Discount( val resourceTypes: List<ResourceType> = emptyList(), diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/moves/CopyGuildMove.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/moves/CopyGuildMove.kt index 3a7fe792..b637eb6c 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/moves/CopyGuildMove.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/moves/CopyGuildMove.kt @@ -3,9 +3,9 @@ package org.luxons.sevenwonders.game.moves import org.luxons.sevenwonders.game.PlayerContext import org.luxons.sevenwonders.game.Settings import org.luxons.sevenwonders.game.api.PlayerMove -import org.luxons.sevenwonders.game.boards.RelativeBoardPosition +import org.luxons.sevenwonders.game.api.boards.RelativeBoardPosition import org.luxons.sevenwonders.game.cards.Card -import org.luxons.sevenwonders.game.cards.Color +import org.luxons.sevenwonders.game.api.cards.Color import org.luxons.sevenwonders.game.effects.SpecialAbility internal class CopyGuildMove(move: PlayerMove, card: Card, player: PlayerContext) : Move(move, card, player) { diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/moves/Move.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/moves/Move.kt index 98a96fd9..134918d0 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/moves/Move.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/moves/Move.kt @@ -3,8 +3,9 @@ package org.luxons.sevenwonders.game.moves import org.luxons.sevenwonders.game.PlayerContext import org.luxons.sevenwonders.game.Settings import org.luxons.sevenwonders.game.api.PlayerMove +import org.luxons.sevenwonders.game.api.MoveType import org.luxons.sevenwonders.game.cards.Card -import org.luxons.sevenwonders.game.resources.ResourceTransactions +import org.luxons.sevenwonders.game.api.resources.ResourceTransactions internal abstract class Move( val move: PlayerMove, diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/resources/BestPriceCalculator.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/resources/BestPriceCalculator.kt index dea6f2c2..6a49449b 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/resources/BestPriceCalculator.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/resources/BestPriceCalculator.kt @@ -1,6 +1,9 @@ package org.luxons.sevenwonders.game.resources import org.luxons.sevenwonders.game.Player +import org.luxons.sevenwonders.game.api.resources.Provider +import org.luxons.sevenwonders.game.api.resources.ResourceTransactions +import org.luxons.sevenwonders.game.api.resources.ResourceType import java.util.EnumSet internal fun bestSolution(resources: Resources, player: Player): TransactionPlan = diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/resources/Production.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/resources/Production.kt index 66a63463..f3c71e2a 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/resources/Production.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/resources/Production.kt @@ -1,5 +1,6 @@ package org.luxons.sevenwonders.game.resources +import org.luxons.sevenwonders.game.api.resources.ResourceType import java.util.EnumSet data class Production internal constructor( diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/resources/ResourceTransactions.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/resources/ResourceTransactions.kt index 134240a5..862b7caf 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/resources/ResourceTransactions.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/resources/ResourceTransactions.kt @@ -1,11 +1,20 @@ package org.luxons.sevenwonders.game.resources import org.luxons.sevenwonders.game.Player +import org.luxons.sevenwonders.game.api.resources.CountedResource +import org.luxons.sevenwonders.game.api.resources.Provider +import org.luxons.sevenwonders.game.api.resources.ResourceTransaction +import org.luxons.sevenwonders.game.api.resources.ResourceTransactions import org.luxons.sevenwonders.game.api.toCountedResourcesList fun Map<Provider, Resources>.toTransactions(): ResourceTransactions = filterValues { !it.isEmpty() } - .map { (p, res) -> ResourceTransaction(p, res.toCountedResourcesList()) } + .map { (p, res) -> + ResourceTransaction( + p, + res.toCountedResourcesList() + ) + } .toSet() fun ResourceTransactions.asResources(): Resources = flatMap { it.resources }.asResources() diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/resources/Resources.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/resources/Resources.kt index 6ffda080..bc893062 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/resources/Resources.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/resources/Resources.kt @@ -1,5 +1,7 @@ package org.luxons.sevenwonders.game.resources +import org.luxons.sevenwonders.game.api.resources.ResourceType + fun emptyResources(): Resources = MutableResources() fun resourcesOf(singleResource: ResourceType): Resources = mapOf(singleResource to 1).toMutableResources() diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/resources/TradingRules.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/resources/TradingRules.kt index a006fadf..c516f4b1 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/resources/TradingRules.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/resources/TradingRules.kt @@ -1,5 +1,10 @@ package org.luxons.sevenwonders.game.resources +import org.luxons.sevenwonders.game.api.resources.Provider +import org.luxons.sevenwonders.game.api.resources.ResourceTransaction +import org.luxons.sevenwonders.game.api.resources.ResourceTransactions +import org.luxons.sevenwonders.game.api.resources.ResourceType + class TradingRules internal constructor(private val defaultCost: Int) { private val costs: MutableMap<ResourceType, MutableMap<Provider, Int>> = mutableMapOf() diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/wonders/Wonder.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/wonders/Wonder.kt index fc2e8676..49ce9a67 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/wonders/Wonder.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/wonders/Wonder.kt @@ -2,11 +2,12 @@ package org.luxons.sevenwonders.game.wonders import org.luxons.sevenwonders.game.Player import org.luxons.sevenwonders.game.boards.Board -import org.luxons.sevenwonders.game.cards.CardBack -import org.luxons.sevenwonders.game.cards.PlayabilityLevel +import org.luxons.sevenwonders.game.api.cards.CardBack +import org.luxons.sevenwonders.game.api.cards.PlayabilityLevel import org.luxons.sevenwonders.game.cards.RequirementsSatisfaction -import org.luxons.sevenwonders.game.resources.ResourceTransactions -import org.luxons.sevenwonders.game.resources.ResourceType +import org.luxons.sevenwonders.game.api.resources.ResourceTransactions +import org.luxons.sevenwonders.game.api.resources.ResourceType +import org.luxons.sevenwonders.game.api.wonders.WonderBuildability internal class Wonder( val name: String, @@ -53,10 +54,11 @@ private object Buildability { isBuildable = false, playabilityLevel = PlayabilityLevel.INCOMPATIBLE_WITH_BOARD ) - internal fun requirementDependent(satisfaction: RequirementsSatisfaction) = WonderBuildability( - isBuildable = satisfaction.satisfied, - minPrice = satisfaction.minPrice, - cheapestTransactions = satisfaction.cheapestTransactions, - playabilityLevel = satisfaction.level - ) + internal fun requirementDependent(satisfaction: RequirementsSatisfaction) = + WonderBuildability( + isBuildable = satisfaction.satisfied, + minPrice = satisfaction.minPrice, + cheapestTransactions = satisfaction.cheapestTransactions, + playabilityLevel = satisfaction.level + ) } diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/wonders/WonderStage.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/wonders/WonderStage.kt index 311e589e..cb2bf386 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/wonders/WonderStage.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/game/wonders/WonderStage.kt @@ -2,10 +2,10 @@ package org.luxons.sevenwonders.game.wonders import org.luxons.sevenwonders.game.Player import org.luxons.sevenwonders.game.boards.Board -import org.luxons.sevenwonders.game.cards.CardBack +import org.luxons.sevenwonders.game.api.cards.CardBack import org.luxons.sevenwonders.game.cards.Requirements import org.luxons.sevenwonders.game.effects.Effect -import org.luxons.sevenwonders.game.resources.ResourceTransactions +import org.luxons.sevenwonders.game.api.resources.ResourceTransactions internal class WonderStage( val requirements: Requirements, |