diff options
author | joffrey-bion <joffrey.bion@gmail.com> | 2021-02-09 19:10:29 +0100 |
---|---|---|
committer | joffrey-bion <joffrey.bion@gmail.com> | 2021-02-09 19:10:29 +0100 |
commit | 5164fc1ebca5fbb656e7ae4108a0d52314a76b10 (patch) | |
tree | 753c96c30aa68f628cade070a78a826b854f0952 /sw-common-model/src/commonMain | |
parent | Add deployment notifications for discord (diff) | |
download | seven-wonders-5164fc1ebca5fbb656e7ae4108a0d52314a76b10.tar.gz seven-wonders-5164fc1ebca5fbb656e7ae4108a0d52314a76b10.tar.bz2 seven-wonders-5164fc1ebca5fbb656e7ae4108a0d52314a76b10.zip |
Improve "join" tooltip for FINISHED games
Diffstat (limited to 'sw-common-model/src/commonMain')
-rw-r--r-- | sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/api/Lobby.kt | 5 |
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, |