From 4f3eec40a87c5e4f52fc89238642dd7a17650540 Mon Sep 17 00:00:00 2001 From: Joffrey Bion Date: Thu, 21 May 2020 13:46:30 +0200 Subject: Allow custom player icons --- .../org/luxons/sevenwonders/client/SevenWondersClient.kt | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'sw-client') diff --git a/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt b/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt index 3dca33c1..ce0ef1fd 100644 --- a/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt +++ b/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt @@ -22,13 +22,7 @@ import org.luxons.sevenwonders.model.PlayerTurnInfo import org.luxons.sevenwonders.model.api.ConnectedPlayer import org.luxons.sevenwonders.model.api.LobbyDTO import org.luxons.sevenwonders.model.api.SEVEN_WONDERS_WS_ENDPOINT -import org.luxons.sevenwonders.model.api.actions.AddBotAction -import org.luxons.sevenwonders.model.api.actions.ChooseNameAction -import org.luxons.sevenwonders.model.api.actions.CreateGameAction -import org.luxons.sevenwonders.model.api.actions.JoinGameAction -import org.luxons.sevenwonders.model.api.actions.PrepareMoveAction -import org.luxons.sevenwonders.model.api.actions.ReorderPlayersAction -import org.luxons.sevenwonders.model.api.actions.UpdateSettingsAction +import org.luxons.sevenwonders.model.api.actions.* import org.luxons.sevenwonders.model.api.errors.ErrorDTO import org.luxons.sevenwonders.model.cards.PreparedCard @@ -63,10 +57,10 @@ class SevenWondersSession(private val stompSession: StompSessionWithKxSerializat fun watchErrors(): Flow = stompSession.subscribe("/user/queue/errors", ErrorDTO.serializer()) - suspend fun chooseName(displayName: String): ConnectedPlayer = stompSession.request( + suspend fun chooseName(displayName: String, icon: Icon? = null): ConnectedPlayer = stompSession.request( sendDestination = "/app/chooseName", receiveDestination = "/user/queue/nameChoice", - payload = ChooseNameAction(displayName), + payload = ChooseNameAction(displayName, icon), serializer = ChooseNameAction.serializer(), deserializer = ConnectedPlayer.serializer() ) -- cgit