diff --git a/knockoutwhistweb/app/controllers/IngameController.scala b/knockoutwhistweb/app/controllers/IngameController.scala index c70aede..1f19c51 100644 --- a/knockoutwhistweb/app/controllers/IngameController.scala +++ b/knockoutwhistweb/app/controllers/IngameController.scala @@ -33,7 +33,7 @@ class IngameController @Inject()( case InGame => Ok(views.html.ingame.ingame( g.getPlayerByUser(request.user), - g.logic + g )) case SelectTrump => Ok(views.html.ingame.selecttrump( diff --git a/knockoutwhistweb/app/logic/game/GameLobby.scala b/knockoutwhistweb/app/logic/game/GameLobby.scala index eedbd58..e7b8edb 100644 --- a/knockoutwhistweb/app/logic/game/GameLobby.scala +++ b/knockoutwhistweb/app/logic/game/GameLobby.scala @@ -180,6 +180,10 @@ class GameLobby private( users.clone() } + def getLogic: GameLogic = { + logic + } + private def getPlayerBySession(userSession: UserSession): AbstractPlayer = { val playerOption = getMatch.totalplayers.find(_.id == userSession.id) if (playerOption.isEmpty) { diff --git a/knockoutwhistweb/app/views/ingame/ingame.scala.html b/knockoutwhistweb/app/views/ingame/ingame.scala.html index f587dbc..302d262 100644 --- a/knockoutwhistweb/app/views/ingame/ingame.scala.html +++ b/knockoutwhistweb/app/views/ingame/ingame.scala.html @@ -1,50 +1,51 @@ -@(player: de.knockoutwhist.player.AbstractPlayer, logic: de.knockoutwhist.control.GameLogic) +@(player: de.knockoutwhist.player.AbstractPlayer, gamelobby: logic.game.GameLobby) @main("Ingame") { -
Next Player:
-@logic.getPlayerQueue.get.duplicate().nextPlayer()
-Trumpsuit:
-@logic.getCurrentRound.get.trumpSuit
+Next Player
+@gamelobby.getLogic.getPlayerQueue.get.duplicate().nextPlayer()
First Card
- @if(logic.getCurrentTrick.get.firstCard.isDefined) { - @util.WebUIUtils.cardtoImage(logic.getCurrentTrick.get.firstCard.get) +Cards played
+Trumpsuit:
+@gamelobby.getLogic.getCurrentRound.get.trumpSuit
+First Card:
+ @if(gamelobby.getLogic.getCurrentTrick.get.firstCard.isDefined) { + @util.WebUIUtils.cardtoImage(gamelobby.getLogic.getCurrentTrick.get.firstCard.get) width="30%"/> } else { - @views.html.render.card.apply("images/cards/1B.png")("Blank Card") + @views.html.render.card.apply("images/cards/1B.png")("Blank Card") width="30%"/> }@logic.getCurrentPlayer.get has to play a card!
- @if(logic.getCurrentTrick.get.cards.nonEmpty) { -Cards played
- } else { -Cards played
- } - -@player
- @util.WebUIUtils.cardtoImage(cardplayed) +Your cards
-