From 07295f3e96a16efc517e5a5e6ae0af4e3d5c5035 Mon Sep 17 00:00:00 2001 From: Joffrey Bion Date: Fri, 15 May 2020 03:05:09 +0200 Subject: Add dumb bots feature --- .../kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 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 480e9d67..e13ab505 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 @@ -18,6 +18,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 @@ -86,6 +87,10 @@ class SevenWondersSession(private val stompSession: StompSessionWithKxSerializat stompSession.sendEmptyMsg("/app/lobby/leave") } + suspend fun addBot(displayName: String) { + stompSession.convertAndSend("/app/lobby/addBot", AddBotAction(displayName), AddBotAction.serializer()) + } + suspend fun reorderPlayers(players: List) { stompSession.convertAndSend("/app/lobby/reorderPlayers", ReorderPlayersAction(players), ReorderPlayersAction.serializer()) } @@ -133,7 +138,4 @@ class SevenWondersSession(private val stompSession: StompSessionWithKxSerializat suspend fun unprepareMove() { stompSession.sendEmptyMsg("/app/game/unprepareMove") } - -// suspend fun watchGameEnd() { -// } } -- cgit