diff --git a/knockoutwhistweb/app/dto/GameInfoDTO.scala b/knockoutwhistweb/app/dto/GameInfoDTO.scala index 6dbb3e0..9395500 100644 --- a/knockoutwhistweb/app/dto/GameInfoDTO.scala +++ b/knockoutwhistweb/app/dto/GameInfoDTO.scala @@ -28,7 +28,7 @@ object GameInfoDTO { hand = selfPlayer.flatMap(_.currentHand()).map(HandDTO(_)), playerQueue = PlayerQueueDTO(lobby.logic), currentTrick = lobby.logic.getCurrentTrick.map(TrickDTO(_)), - currentRound = lobby.logic.getCurrentRound.map(RoundDTO(_)) + currentRound = lobby.logic.getCurrentRound.map(r => RoundDTO(r, lobby.logic.getCurrentMatch)) ) } diff --git a/knockoutwhistweb/app/dto/subDTO/RoundDTO.scala b/knockoutwhistweb/app/dto/subDTO/RoundDTO.scala index 1bd89cb..8cca2b5 100644 --- a/knockoutwhistweb/app/dto/subDTO/RoundDTO.scala +++ b/knockoutwhistweb/app/dto/subDTO/RoundDTO.scala @@ -2,14 +2,16 @@ package dto.subDTO import de.knockoutwhist.cards.Card import de.knockoutwhist.cards.CardValue.Ace +import de.knockoutwhist.rounds.{Match, Round} -case class RoundDTO(trumpSuit: CardDTO, firstRound: Boolean, trickList: List[TrickDTO]) +case class RoundDTO(trumpSuit: CardDTO, playersIn: Seq[PlayerDTO], firstRound: Boolean, trickList: List[TrickDTO]) object RoundDTO { - def apply(round: de.knockoutwhist.rounds.Round): RoundDTO = { + def apply(round: Round, matchImpl: Option[Match]): RoundDTO = { RoundDTO( trumpSuit = CardDTO(Card(Ace, round.trumpSuit)), + playersIn = matchImpl.map(_.playersIn.map(PlayerDTO(_))).getOrElse(Seq.empty), firstRound = round.firstRound, trickList = round.tricklist.map(trick => TrickDTO(trick)) )