diff options
author | Joffrey Bion <joffrey.bion@booking.com> | 2020-04-01 23:16:45 +0200 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@booking.com> | 2020-04-01 23:16:45 +0200 |
commit | 607466dd5e9940b4d73246c9bfcdeccec90d665c (patch) | |
tree | d4fa77275bfc97618eb19bc7733c24a6f5b263b4 /sw-server | |
parent | Remove manual LinearDimension invocation (diff) | |
download | seven-wonders-607466dd5e9940b4d73246c9bfcdeccec90d665c.tar.gz seven-wonders-607466dd5e9940b4d73246c9bfcdeccec90d665c.tar.bz2 seven-wonders-607466dd5e9940b4d73246c9bfcdeccec90d665c.zip |
Hide currently prepared card from hand
Diffstat (limited to 'sw-server')
-rw-r--r-- | sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameController.kt | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameController.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameController.kt index 733259b9..5fd5f2e4 100644 --- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameController.kt +++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameController.kt @@ -2,8 +2,7 @@ package org.luxons.sevenwonders.server.controllers import org.hildan.livedoc.core.annotations.Api import org.luxons.sevenwonders.engine.Game -import org.luxons.sevenwonders.model.Action -import org.luxons.sevenwonders.model.PlayerTurnInfo +import org.luxons.sevenwonders.model.PlayerMove import org.luxons.sevenwonders.model.api.actions.PrepareMoveAction import org.luxons.sevenwonders.model.cards.PreparedCard import org.luxons.sevenwonders.model.hideHandsAndWaitForReadiness @@ -14,6 +13,7 @@ import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired import org.springframework.messaging.handler.annotation.MessageMapping import org.springframework.messaging.simp.SimpMessagingTemplate +import org.springframework.messaging.simp.annotation.SendToUser import org.springframework.stereotype.Controller import java.security.Principal @@ -63,7 +63,8 @@ class GameController @Autowired constructor( * the connected user's information */ @MessageMapping("/game/prepareMove") - fun prepareMove(action: PrepareMoveAction, principal: Principal) { + @SendToUser("/queue/game/preparedMove") + fun prepareMove(action: PrepareMoveAction, principal: Principal): PlayerMove { val player = principal.player val game = player.game val preparedCardBack = game.prepareMove(player.index, action.move) @@ -76,6 +77,7 @@ class GameController @Autowired constructor( game.playTurn() sendTurnInfo(player.lobby.getPlayers(), game, true) } + return action.move } private fun sendPlayerReady(gameId: Long, player: Player) = |