summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/wonders/Wonders.kt3
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/lobby/Lobby.kt6
2 files changed, 3 insertions, 6 deletions
diff --git a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/wonders/Wonders.kt b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/wonders/Wonders.kt
index dbca061e..778c8b80 100644
--- a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/wonders/Wonders.kt
+++ b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/wonders/Wonders.kt
@@ -20,7 +20,6 @@ data class PreGameWonder(
data class AssignedWonder(
val name: WonderName,
val side: WonderSide,
- val image: String,
)
enum class WonderSide {
@@ -33,7 +32,7 @@ fun List<PreGameWonder>.deal(nbPlayers: Int, random: Random = Random): List<Assi
fun PreGameWonder.withRandomSide(random: Random = Random): AssignedWonder = withSide(WonderSide.values().random(random))
-fun PreGameWonder.withSide(side: WonderSide): AssignedWonder = AssignedWonder(name, side, images.getValue(side))
+fun PreGameWonder.withSide(side: WonderSide): AssignedWonder = AssignedWonder(name, side)
@Serializable
data class ApiWonder(
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/lobby/Lobby.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/lobby/Lobby.kt
index e0dba284..7774d517 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/lobby/Lobby.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/lobby/Lobby.kt
@@ -4,9 +4,7 @@ import org.luxons.sevenwonders.engine.Game
import org.luxons.sevenwonders.engine.data.GameDefinition
import org.luxons.sevenwonders.model.Settings
import org.luxons.sevenwonders.model.api.State
-import org.luxons.sevenwonders.model.wonders.AssignedWonder
-import org.luxons.sevenwonders.model.wonders.PreGameWonder
-import org.luxons.sevenwonders.model.wonders.withRandomSide
+import org.luxons.sevenwonders.model.wonders.*
class Lobby(
val id: Long,
@@ -87,7 +85,7 @@ class Lobby(
fun reassignWonders(wonders: List<AssignedWonder>) {
require(wonders.size == players.size)
wonders.forEach {
- require(it.name in allWonders.map { w -> w.name })
+ require(it.name in allWonders.map { w -> w.name }) { "Unknown wonder '${it.name}'" }
}
assignedWonders.clear()
assignedWonders.addAll(wonders)
bgstack15