diff options
author | Joffrey Bion <joffrey.bion@booking.com> | 2020-05-28 20:26:29 +0200 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@booking.com> | 2020-05-31 11:16:00 +0200 |
commit | 36103b92ce4b6cd00925d861f4fb5e381cdc4833 (patch) | |
tree | 4c2bfced8317526b24da23fcef9febe6368c736e /sw-client | |
parent | Attempt at fixing race conditions with bot subscriptions (diff) | |
download | seven-wonders-36103b92ce4b6cd00925d861f4fb5e381cdc4833.tar.gz seven-wonders-36103b92ce4b6cd00925d861f4fb5e381cdc4833.tar.bz2 seven-wonders-36103b92ce4b6cd00925d861f4fb5e381cdc4833.zip |
Simplify settings and allow choosing wonders
Diffstat (limited to 'sw-client')
-rw-r--r-- | sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt | 9 |
1 files changed, 7 insertions, 2 deletions
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 e904986a..8adbfa07 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 @@ -14,9 +14,10 @@ import org.hildan.krossbow.stomp.conversions.kxserialization.convertAndSend import org.hildan.krossbow.stomp.conversions.kxserialization.subscribe import org.hildan.krossbow.stomp.conversions.kxserialization.withJsonConversions import org.hildan.krossbow.stomp.sendEmptyMsg -import org.luxons.sevenwonders.model.CustomizableSettings +import org.luxons.sevenwonders.model.Settings import org.luxons.sevenwonders.model.PlayerMove import org.luxons.sevenwonders.model.PlayerTurnInfo +import org.luxons.sevenwonders.model.wonders.AssignedWonder import org.luxons.sevenwonders.model.api.ConnectedPlayer import org.luxons.sevenwonders.model.api.LobbyDTO import org.luxons.sevenwonders.model.api.SEVEN_WONDERS_WS_ENDPOINT @@ -98,7 +99,11 @@ class SevenWondersSession(private val stompSession: StompSessionWithKxSerializat stompSession.convertAndSend("/app/lobby/reorderPlayers", ReorderPlayersAction(players), ReorderPlayersAction.serializer()) } - suspend fun updateSettings(settings: CustomizableSettings) { + suspend fun reassignWonders(wonders: List<AssignedWonder>) { + stompSession.convertAndSend("/app/lobby/reassignWonders", ReassignWondersAction(wonders), ReassignWondersAction.serializer()) + } + + suspend fun updateSettings(settings: Settings) { stompSession.convertAndSend("/app/lobby/updateSettings", UpdateSettingsAction(settings), UpdateSettingsAction.serializer()) } |