feat: FRO-20 Create scoreboard component

This commit is contained in:
2025-12-10 14:11:10 +01:00
parent 266cbe7509
commit f20076c16d
2 changed files with 5 additions and 3 deletions

View File

@@ -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))
)
}

View File

@@ -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))
)