summaryrefslogtreecommitdiff
path: root/sw-common-model/src
diff options
context:
space:
mode:
authorJoffrey BION <joffrey.bion@gmail.com>2019-05-22 02:40:48 +0200
committerJoffrey BION <joffrey.bion@gmail.com>2019-05-22 02:40:48 +0200
commit157edc9b8027f63998758d3c91cbaa1053550f0f (patch)
tree3c5b1b6b4c3c33f1493d6ef2a5ec71a796b24603 /sw-common-model/src
parentReorder subprojects in settings.gradle to make more sense (diff)
downloadseven-wonders-157edc9b8027f63998758d3c91cbaa1053550f0f.tar.gz
seven-wonders-157edc9b8027f63998758d3c91cbaa1053550f0f.tar.bz2
seven-wonders-157edc9b8027f63998758d3c91cbaa1053550f0f.zip
Reorganize packages again
Diffstat (limited to 'sw-common-model/src')
-rw-r--r--sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/CustomizableSettings.kt (renamed from sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/CustomizableSettings.kt)2
-rw-r--r--sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/Moves.kt (renamed from sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/Moves.kt)12
-rw-r--r--sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/Table.kt (renamed from sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/Table.kt)6
-rw-r--r--sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/boards/Boards.kt (renamed from sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/boards/Boards.kt)10
-rw-r--r--sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/boards/RelativeBoardPosition.kt (renamed from sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/boards/RelativeBoardPosition.kt)7
-rw-r--r--sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/cards/Cards.kt (renamed from sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/cards/Cards.kt)6
-rw-r--r--sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/cards/HandRotationDirection.kt (renamed from sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/cards/HandRotationDirection.kt)2
-rw-r--r--sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/resources/Resources.kt (renamed from sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/resources/Resources.kt)4
-rw-r--r--sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/wonders/Wonders.kt (renamed from sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/wonders/Wonders.kt)12
-rw-r--r--sw-common-model/src/commonTest/kotlin/org/luxons/sevenwonders/model/WonderSidePickMethodTest.kt (renamed from sw-common-model/src/commonTest/kotlin/org/luxons/sevenwonders/game/api/WonderSidePickMethodTest.kt)10
10 files changed, 39 insertions, 32 deletions
diff --git a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/CustomizableSettings.kt b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/CustomizableSettings.kt
index ac2c2b14..e23a05a1 100644
--- a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/CustomizableSettings.kt
+++ b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/CustomizableSettings.kt
@@ -1,4 +1,4 @@
-package org.luxons.sevenwonders.game.api
+package org.luxons.sevenwonders.model
import kotlin.random.Random
diff --git a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/Moves.kt b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/Moves.kt
index 79a238b0..9a80b82a 100644
--- a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/Moves.kt
+++ b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/Moves.kt
@@ -1,10 +1,10 @@
-package org.luxons.sevenwonders.game.api
+package org.luxons.sevenwonders.model
-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
+import org.luxons.sevenwonders.model.cards.HandCard
+import org.luxons.sevenwonders.model.cards.TableCard
+import org.luxons.sevenwonders.model.resources.ResourceTransactions
+import org.luxons.sevenwonders.model.resources.noTransactions
+import org.luxons.sevenwonders.model.wonders.WonderBuildability
enum class Action(val message: String) {
PLAY("Pick the card you want to play or discard."),
diff --git a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/Table.kt b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/Table.kt
index 62f66b21..2e29090e 100644
--- a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/Table.kt
+++ b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/Table.kt
@@ -1,7 +1,7 @@
-package org.luxons.sevenwonders.game.api
+package org.luxons.sevenwonders.model
-import org.luxons.sevenwonders.game.api.boards.ApiBoard
-import org.luxons.sevenwonders.game.api.cards.HandRotationDirection
+import org.luxons.sevenwonders.model.boards.ApiBoard
+import org.luxons.sevenwonders.model.cards.HandRotationDirection
typealias Age = Int
diff --git a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/boards/Boards.kt b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/boards/Boards.kt
index 061bdcad..a91b2488 100644
--- a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/boards/Boards.kt
+++ b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/boards/Boards.kt
@@ -1,9 +1,9 @@
-package org.luxons.sevenwonders.game.api.boards
+package org.luxons.sevenwonders.model.boards
-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
+import org.luxons.sevenwonders.model.cards.TableCard
+import org.luxons.sevenwonders.model.resources.CountedResource
+import org.luxons.sevenwonders.model.resources.ResourceType
+import org.luxons.sevenwonders.model.wonders.ApiWonder
data class ApiBoard(
val playerIndex: Int,
diff --git a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/boards/RelativeBoardPosition.kt b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/boards/RelativeBoardPosition.kt
index c7c3b5dc..f2450c5d 100644
--- a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/boards/RelativeBoardPosition.kt
+++ b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/boards/RelativeBoardPosition.kt
@@ -1,4 +1,4 @@
-package org.luxons.sevenwonders.game.api.boards
+package org.luxons.sevenwonders.model.boards
enum class RelativeBoardPosition(private val offset: Int) {
LEFT(-1),
@@ -8,7 +8,10 @@ enum class RelativeBoardPosition(private val offset: Int) {
fun getIndexFrom(playerIndex: Int, nbPlayers: Int): Int = (playerIndex + offset) floorMod nbPlayers
}
-fun neighboursPositions() = listOf(RelativeBoardPosition.LEFT, RelativeBoardPosition.RIGHT)
+fun neighboursPositions() = listOf(
+ RelativeBoardPosition.LEFT,
+ RelativeBoardPosition.RIGHT
+)
private infix fun Int.floorMod(divisor: Int): Int {
val rem = this % divisor
diff --git a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/cards/Cards.kt b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/cards/Cards.kt
index 4ccfe23b..d0121019 100644
--- a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/cards/Cards.kt
+++ b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/cards/Cards.kt
@@ -1,7 +1,7 @@
-package org.luxons.sevenwonders.game.api.cards
+package org.luxons.sevenwonders.model.cards
-import org.luxons.sevenwonders.game.api.boards.ApiRequirements
-import org.luxons.sevenwonders.game.api.resources.ResourceTransactions
+import org.luxons.sevenwonders.model.boards.ApiRequirements
+import org.luxons.sevenwonders.model.resources.ResourceTransactions
data class TableCard(
val name: String,
diff --git a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/cards/HandRotationDirection.kt b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/cards/HandRotationDirection.kt
index b4669fbb..3f921409 100644
--- a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/cards/HandRotationDirection.kt
+++ b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/cards/HandRotationDirection.kt
@@ -1,4 +1,4 @@
-package org.luxons.sevenwonders.game.api.cards
+package org.luxons.sevenwonders.model.cards
enum class HandRotationDirection {
LEFT,
diff --git a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/resources/Resources.kt b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/resources/Resources.kt
index fcfdd634..905f8abf 100644
--- a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/resources/Resources.kt
+++ b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/resources/Resources.kt
@@ -1,6 +1,6 @@
-package org.luxons.sevenwonders.game.api.resources
+package org.luxons.sevenwonders.model.resources
-import org.luxons.sevenwonders.game.api.boards.RelativeBoardPosition
+import org.luxons.sevenwonders.model.boards.RelativeBoardPosition
enum class ResourceType(val symbol: Char) {
WOOD('W'),
diff --git a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/wonders/Wonders.kt b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/wonders/Wonders.kt
index 7148a924..73fd6a30 100644
--- a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/game/api/wonders/Wonders.kt
+++ b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/wonders/Wonders.kt
@@ -1,10 +1,10 @@
-package org.luxons.sevenwonders.game.api.wonders
+package org.luxons.sevenwonders.model.wonders
-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
+import org.luxons.sevenwonders.model.boards.ApiRequirements
+import org.luxons.sevenwonders.model.cards.CardBack
+import org.luxons.sevenwonders.model.cards.PlayabilityLevel
+import org.luxons.sevenwonders.model.resources.ResourceTransactions
+import org.luxons.sevenwonders.model.resources.ResourceType
data class ApiWonder(
val name: String,
diff --git a/sw-common-model/src/commonTest/kotlin/org/luxons/sevenwonders/game/api/WonderSidePickMethodTest.kt b/sw-common-model/src/commonTest/kotlin/org/luxons/sevenwonders/model/WonderSidePickMethodTest.kt
index 9757ff86..70a061e3 100644
--- a/sw-common-model/src/commonTest/kotlin/org/luxons/sevenwonders/game/api/WonderSidePickMethodTest.kt
+++ b/sw-common-model/src/commonTest/kotlin/org/luxons/sevenwonders/model/WonderSidePickMethodTest.kt
@@ -1,4 +1,4 @@
-package org.luxons.sevenwonders.game.api
+package org.luxons.sevenwonders.model
import kotlin.random.Random
import kotlin.test.BeforeTest
@@ -70,11 +70,15 @@ class WonderSidePickMethodTest {
@Test
fun pick_allSameRandom_sameAsFirst() {
repeat(10) {
- val side = WonderSidePickMethod.SAME_RANDOM_FOR_ALL.pickSide(random, WonderSide.A)
+ val side = WonderSidePickMethod.SAME_RANDOM_FOR_ALL.pickSide(random,
+ WonderSide.A
+ )
assertEquals(WonderSide.A, side)
}
repeat(10) {
- val side = WonderSidePickMethod.SAME_RANDOM_FOR_ALL.pickSide(random, WonderSide.B)
+ val side = WonderSidePickMethod.SAME_RANDOM_FOR_ALL.pickSide(random,
+ WonderSide.B
+ )
assertEquals(WonderSide.B, side)
}
}
bgstack15