feat: Update routing and websocket configuration for game state management

This commit is contained in:
2025-12-11 10:24:51 +01:00
parent 13038b0cb9
commit 683ad58efe
6 changed files with 11 additions and 17 deletions

View File

@@ -2,13 +2,13 @@ package dto.subDTO
import de.knockoutwhist.cards.Hand
case class HandDTO(card: List[CardDTO])
case class HandDTO(cards: List[CardDTO])
object HandDTO {
def apply(hand: Hand): HandDTO = {
HandDTO(
card = hand.cards.zipWithIndex.map { case (card, idx) => CardDTO(card, idx) }
cards = hand.cards.zipWithIndex.map { case (card, idx) => CardDTO(card, idx) }
)
}

View File

@@ -8,7 +8,7 @@ object TrickDTO {
def apply(trick: Trick): TrickDTO = {
TrickDTO(
cards = trick.cards.map { case (card, player) => player.id.toString -> CardDTO(card) },
cards = trick.cards.map { case (card, player) => player.name -> CardDTO(card) },
firstCard = trick.firstCard.map(card => CardDTO(card)),
winner = trick.winner.map(player => PlayerDTO(player))
)