diff options
author | Joffrey Bion <joffrey.bion@booking.com> | 2020-05-21 13:46:30 +0200 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@booking.com> | 2020-05-21 13:58:28 +0200 |
commit | 4f3eec40a87c5e4f52fc89238642dd7a17650540 (patch) | |
tree | c910270b5477975100bfd82852d784409346f334 /sw-common-model/src | |
parent | Prevent bots with already used names (diff) | |
download | seven-wonders-4f3eec40a87c5e4f52fc89238642dd7a17650540.tar.gz seven-wonders-4f3eec40a87c5e4f52fc89238642dd7a17650540.tar.bz2 seven-wonders-4f3eec40a87c5e4f52fc89238642dd7a17650540.zip |
Allow custom player icons
Diffstat (limited to 'sw-common-model/src')
-rw-r--r-- | sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/api/Api.kt | 5 | ||||
-rw-r--r-- | sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/api/actions/Actions.kt | 11 |
2 files changed, 14 insertions, 2 deletions
diff --git a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/api/Api.kt b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/api/Api.kt index 7fe266b9..7a337f9a 100644 --- a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/api/Api.kt +++ b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/api/Api.kt @@ -1,6 +1,7 @@ package org.luxons.sevenwonders.model.api import kotlinx.serialization.Serializable +import org.luxons.sevenwonders.model.api.actions.Icon const val SEVEN_WONDERS_WS_ENDPOINT = "/seven-wonders-websocket" @@ -46,13 +47,15 @@ data class Actionability( @Serializable data class ConnectedPlayer( val username: String, - val displayName: String + val displayName: String, + val icon: Icon? ) @Serializable data class PlayerDTO( val username: String, val displayName: String, + val icon: Icon?, val index: Int, val isGameOwner: Boolean, val isReady: Boolean diff --git a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/api/actions/Actions.kt b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/api/actions/Actions.kt index a4467667..0687e968 100644 --- a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/api/actions/Actions.kt +++ b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/api/actions/Actions.kt @@ -12,7 +12,16 @@ class ChooseNameAction( /** * The display name of the player. May contain spaces and special characters. */ - val playerName: String + val playerName: String, + /** + * The player's icon. + */ + val icon: Icon? +) + +@Serializable +data class Icon( + val name: String ) /** |