diff options
author | Joffrey Bion <joffrey.bion@gmail.com> | 2021-03-08 00:12:06 +0100 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@gmail.com> | 2021-03-08 00:12:06 +0100 |
commit | 4e75c416e268da88ca2ca74530575241984c9ba0 (patch) | |
tree | f28185c01ee52312abe9d1e5ae14b637914658af /sw-common-model/src | |
parent | Move GameState to the client (diff) | |
download | seven-wonders-4e75c416e268da88ca2ca74530575241984c9ba0.tar.gz seven-wonders-4e75c416e268da88ca2ca74530575241984c9ba0.tar.bz2 seven-wonders-4e75c416e268da88ca2ca74530575241984c9ba0.zip |
Make SayReady action an object
Diffstat (limited to 'sw-common-model/src')
-rw-r--r-- | sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/PlayerState.kt | 2 | ||||
-rw-r--r-- | sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/TurnActions.kt | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/PlayerState.kt b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/PlayerState.kt index 90d23aa9..1e483a56 100644 --- a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/PlayerState.kt +++ b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/PlayerState.kt @@ -14,4 +14,4 @@ data class PlayerTurnInfo( } // TODO move to server code -fun Collection<PlayerTurnInfo>.hideHandsAndWaitForReadiness() = map { it.copy(action = TurnAction.SayReady()) } +fun Collection<PlayerTurnInfo>.hideHandsAndWaitForReadiness() = map { it.copy(action = TurnAction.SayReady) } diff --git a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/TurnActions.kt b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/TurnActions.kt index bd94944b..af01dccd 100644 --- a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/TurnActions.kt +++ b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/TurnActions.kt @@ -23,9 +23,11 @@ sealed class TurnAction { abstract val message: String @Serializable - data class SayReady( - override val message: String = ActionMessages.SAY_READY, - ) : TurnAction() + object SayReady : TurnAction() { + override val message: String = ActionMessages.SAY_READY + + override fun toString(): String = "Say Ready" + } @Serializable data class PlayFromHand( |