summaryrefslogtreecommitdiff
path: root/sw-common-model/src/main
diff options
context:
space:
mode:
authorJoffrey BION <joffrey.bion@gmail.com>2019-05-22 01:41:08 +0200
committerJoffrey BION <joffrey.bion@gmail.com>2019-05-22 01:41:08 +0200
commit2428a88a5400ca9aa5465beb5ecf06491acad3c7 (patch)
treeb35371d87a12b6247e15073dcf6f59c4ab7bcda7 /sw-common-model/src/main
parentComment plugin management related to unused multiplatform plugin (diff)
downloadseven-wonders-2428a88a5400ca9aa5465beb5ecf06491acad3c7.tar.gz
seven-wonders-2428a88a5400ca9aa5465beb5ecf06491acad3c7.tar.bz2
seven-wonders-2428a88a5400ca9aa5465beb5ecf06491acad3c7.zip
Move common module declarations into api package
Diffstat (limited to 'sw-common-model/src/main')
-rw-r--r--sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/ApiTable.kt25
-rw-r--r--sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/Moves.kt (renamed from sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/PlayerTurnInfo.kt)26
-rw-r--r--sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/Table.kt15
-rw-r--r--sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/boards/Boards.kt (renamed from sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/boards/Boards.kt)10
-rw-r--r--sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/boards/RelativeBoardPosition.kt (renamed from sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/boards/RelativeBoardPosition.kt)2
-rw-r--r--sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/cards/Cards.kt (renamed from sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/cards/Cards.kt)6
-rw-r--r--sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/cards/HandRotationDirection.kt (renamed from sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/cards/HandRotationDirection.kt)2
-rw-r--r--sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/resources/Resources.kt (renamed from sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/resources/Resources.kt)4
-rw-r--r--sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/wonders/Wonders.kt (renamed from sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/wonders/Wonder.kt)12
-rw-r--r--sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/moves/MoveType.kt9
10 files changed, 53 insertions, 58 deletions
diff --git a/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/ApiTable.kt b/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/ApiTable.kt
deleted file mode 100644
index 595064b1..00000000
--- a/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/ApiTable.kt
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.luxons.sevenwonders.game.api
-
-import org.luxons.sevenwonders.game.boards.ApiBoard
-import org.luxons.sevenwonders.game.cards.HandRotationDirection
-import org.luxons.sevenwonders.game.cards.TableCard
-import org.luxons.sevenwonders.game.moves.MoveType
-import org.luxons.sevenwonders.game.resources.ResourceTransactions
-
-typealias Age = Int
-
-data class ApiTable(
- val boards: List<ApiBoard>,
- val currentAge: Age,
- val handRotationDirection: HandRotationDirection,
- val lastPlayedMoves: List<PlayedMove>
-) {
- val nbPlayers: Int = boards.size
-}
-
-data class PlayedMove(
- val playerIndex: Int,
- val type: MoveType,
- val card: TableCard,
- val transactions: ResourceTransactions
-)
diff --git a/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/PlayerTurnInfo.kt b/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/Moves.kt
index db177fee..79a238b0 100644
--- a/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/PlayerTurnInfo.kt
+++ b/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/Moves.kt
@@ -1,11 +1,10 @@
package org.luxons.sevenwonders.game.api
-import org.luxons.sevenwonders.game.cards.HandCard
-import org.luxons.sevenwonders.game.cards.TableCard
-import org.luxons.sevenwonders.game.moves.MoveType
-import org.luxons.sevenwonders.game.resources.ResourceTransactions
-import org.luxons.sevenwonders.game.resources.noTransactions
-import org.luxons.sevenwonders.game.wonders.WonderBuildability
+import org.luxons.sevenwonders.game.api.cards.HandCard
+import org.luxons.sevenwonders.game.api.cards.TableCard
+import org.luxons.sevenwonders.game.api.resources.ResourceTransactions
+import org.luxons.sevenwonders.game.api.resources.noTransactions
+import org.luxons.sevenwonders.game.api.wonders.WonderBuildability
enum class Action(val message: String) {
PLAY("Pick the card you want to play or discard."),
@@ -28,8 +27,23 @@ data class PlayerTurnInfo(
val wonderBuildability: WonderBuildability = table.boards[playerIndex].wonder.buildability
}
+data class PlayedMove(
+ val playerIndex: Int,
+ val type: MoveType,
+ val card: TableCard,
+ val transactions: ResourceTransactions
+)
+
data class PlayerMove(
val type: MoveType,
val cardName: String,
val transactions: ResourceTransactions = noTransactions()
)
+
+enum class MoveType {
+ PLAY,
+ PLAY_FREE,
+ UPGRADE_WONDER,
+ DISCARD,
+ COPY_GUILD;
+}
diff --git a/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/Table.kt b/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/Table.kt
new file mode 100644
index 00000000..62f66b21
--- /dev/null
+++ b/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/Table.kt
@@ -0,0 +1,15 @@
+package org.luxons.sevenwonders.game.api
+
+import org.luxons.sevenwonders.game.api.boards.ApiBoard
+import org.luxons.sevenwonders.game.api.cards.HandRotationDirection
+
+typealias Age = Int
+
+data class ApiTable(
+ val boards: List<ApiBoard>,
+ val currentAge: Age,
+ val handRotationDirection: HandRotationDirection,
+ val lastPlayedMoves: List<PlayedMove>
+) {
+ val nbPlayers: Int = boards.size
+}
diff --git a/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/boards/Boards.kt b/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/boards/Boards.kt
index eb044cf2..061bdcad 100644
--- a/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/boards/Boards.kt
+++ b/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/boards/Boards.kt
@@ -1,9 +1,9 @@
-package org.luxons.sevenwonders.game.boards
+package org.luxons.sevenwonders.game.api.boards
-import org.luxons.sevenwonders.game.cards.TableCard
-import org.luxons.sevenwonders.game.resources.CountedResource
-import org.luxons.sevenwonders.game.resources.ResourceType
-import org.luxons.sevenwonders.game.wonders.ApiWonder
+import org.luxons.sevenwonders.game.api.cards.TableCard
+import org.luxons.sevenwonders.game.api.resources.CountedResource
+import org.luxons.sevenwonders.game.api.resources.ResourceType
+import org.luxons.sevenwonders.game.api.wonders.ApiWonder
data class ApiBoard(
val playerIndex: Int,
diff --git a/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/boards/RelativeBoardPosition.kt b/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/boards/RelativeBoardPosition.kt
index 3a8387a3..c7c3b5dc 100644
--- a/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/boards/RelativeBoardPosition.kt
+++ b/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/boards/RelativeBoardPosition.kt
@@ -1,4 +1,4 @@
-package org.luxons.sevenwonders.game.boards
+package org.luxons.sevenwonders.game.api.boards
enum class RelativeBoardPosition(private val offset: Int) {
LEFT(-1),
diff --git a/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/cards/Cards.kt b/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/cards/Cards.kt
index 1fc228d1..4ccfe23b 100644
--- a/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/cards/Cards.kt
+++ b/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/cards/Cards.kt
@@ -1,7 +1,7 @@
-package org.luxons.sevenwonders.game.cards
+package org.luxons.sevenwonders.game.api.cards
-import org.luxons.sevenwonders.game.boards.ApiRequirements
-import org.luxons.sevenwonders.game.resources.ResourceTransactions
+import org.luxons.sevenwonders.game.api.boards.ApiRequirements
+import org.luxons.sevenwonders.game.api.resources.ResourceTransactions
data class TableCard(
val name: String,
diff --git a/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/cards/HandRotationDirection.kt b/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/cards/HandRotationDirection.kt
index a10ec19f..b4669fbb 100644
--- a/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/cards/HandRotationDirection.kt
+++ b/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/cards/HandRotationDirection.kt
@@ -1,4 +1,4 @@
-package org.luxons.sevenwonders.game.cards
+package org.luxons.sevenwonders.game.api.cards
enum class HandRotationDirection {
LEFT,
diff --git a/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/resources/Resources.kt b/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/resources/Resources.kt
index 926cd570..fcfdd634 100644
--- a/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/resources/Resources.kt
+++ b/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/resources/Resources.kt
@@ -1,6 +1,6 @@
-package org.luxons.sevenwonders.game.resources
+package org.luxons.sevenwonders.game.api.resources
-import org.luxons.sevenwonders.game.boards.RelativeBoardPosition
+import org.luxons.sevenwonders.game.api.boards.RelativeBoardPosition
enum class ResourceType(val symbol: Char) {
WOOD('W'),
diff --git a/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/wonders/Wonder.kt b/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/wonders/Wonders.kt
index 13fee8e2..7148a924 100644
--- a/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/wonders/Wonder.kt
+++ b/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/api/wonders/Wonders.kt
@@ -1,10 +1,10 @@
-package org.luxons.sevenwonders.game.wonders
+package org.luxons.sevenwonders.game.api.wonders
-import org.luxons.sevenwonders.game.boards.ApiRequirements
-import org.luxons.sevenwonders.game.cards.CardBack
-import org.luxons.sevenwonders.game.cards.PlayabilityLevel
-import org.luxons.sevenwonders.game.resources.ResourceTransactions
-import org.luxons.sevenwonders.game.resources.ResourceType
+import org.luxons.sevenwonders.game.api.boards.ApiRequirements
+import org.luxons.sevenwonders.game.api.cards.CardBack
+import org.luxons.sevenwonders.game.api.cards.PlayabilityLevel
+import org.luxons.sevenwonders.game.api.resources.ResourceTransactions
+import org.luxons.sevenwonders.game.api.resources.ResourceType
data class ApiWonder(
val name: String,
diff --git a/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/moves/MoveType.kt b/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/moves/MoveType.kt
deleted file mode 100644
index d982c100..00000000
--- a/sw-common-model/src/main/kotlin/org/luxons/sevenwonders/game/moves/MoveType.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.luxons.sevenwonders.game.moves
-
-enum class MoveType {
- PLAY,
- PLAY_FREE,
- UPGRADE_WONDER,
- DISCARD,
- COPY_GUILD;
-}
bgstack15