summaryrefslogtreecommitdiff
path: root/sw-client/src/commonMain/kotlin/org/luxons
diff options
context:
space:
mode:
authorJoffrey Bion <joffrey.bion@booking.com>2020-05-15 03:05:09 +0200
committerJoffrey Bion <joffrey.bion@booking.com>2020-05-15 03:29:28 +0200
commit07295f3e96a16efc517e5a5e6ae0af4e3d5c5035 (patch)
tree3d35ea3d249d6f1205700d73996f9d93b6582162 /sw-client/src/commonMain/kotlin/org/luxons
parentSend score at end of game (diff)
downloadseven-wonders-07295f3e96a16efc517e5a5e6ae0af4e3d5c5035.tar.gz
seven-wonders-07295f3e96a16efc517e5a5e6ae0af4e3d5c5035.tar.bz2
seven-wonders-07295f3e96a16efc517e5a5e6ae0af4e3d5c5035.zip
Add dumb bots feature
Diffstat (limited to 'sw-client/src/commonMain/kotlin/org/luxons')
-rw-r--r--sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt8
1 files changed, 5 insertions, 3 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 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<String>) {
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() {
-// }
}
bgstack15