From 2a29ca8cdd3ef55f6f66f00b5e7727e1b1af1458 Mon Sep 17 00:00:00 2001 From: Janis Date: Wed, 10 Dec 2025 14:12:48 +0100 Subject: [PATCH] feat: FRO-20 Create scoreboard component (#106) Reviewed-on: https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/pulls/106 Co-authored-by: Janis Co-committed-by: Janis --- knockoutwhistweb/app/dto/GameInfoDTO.scala | 2 +- knockoutwhistweb/app/dto/subDTO/RoundDTO.scala | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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)) )