summaryrefslogtreecommitdiff
path: root/sw-common-model
diff options
context:
space:
mode:
Diffstat (limited to 'sw-common-model')
-rw-r--r--sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/api/Lobby.kt5
1 files changed, 4 insertions, 1 deletions
diff --git a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/api/Lobby.kt b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/api/Lobby.kt
index 7c9ed800..59515057 100644
--- a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/api/Lobby.kt
+++ b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/api/Lobby.kt
@@ -54,7 +54,10 @@ data class LobbyDTO(
fun findWonder(name: String): PreGameWonder = wondersByName[name] ?: error("Unknown wonder '$name'")
fun joinability(userDisplayName: String): Actionability = when {
- state != State.LOBBY -> Actionability(false, "Cannot join: the game has already started")
+ state == State.PLAYING -> Actionability(false, "Cannot join: the game has already started")
+ state == State.FINISHED -> Actionability(false, "Cannot join: the game is over")
+ // should only ever happen if a new state is added
+ state != State.LOBBY -> Actionability(false, "Cannot join the game at this time")
maxPlayersReached -> Actionability(false, "Cannot join: the game is full")
playerNameAlreadyUsed(userDisplayName) -> Actionability(
canDo = false,
bgstack15