feat: Implement PlayDogCard functionality in user session and update Vue component

This commit is contained in:
2026-01-07 22:02:13 +01:00
parent 98fa5f63d6
commit 61ae9b5a5e
2 changed files with 11 additions and 1 deletions

View File

@@ -54,6 +54,16 @@ class UserSession(val user: User, val host: Boolean, val gameLobby: GameLobby) e
case None =>
println("Card Index not found or is not a number." + data)
}
case "PlayDogCard" =>
val maybeCardIndex: Option[Int] = (data \ "cardindex").asOpt[Int]
maybeCardIndex match {
case Some(index) =>
val session = gameLobby.getUserSession(user.id)
gameLobby.playDogCard(session, index)
case None =>
val session = gameLobby.getUserSession(user.id)
gameLobby.playDogCard(session, -1)
}
case "PickTrumpsuit" =>
val maybeSuitIndex: Option[Int] = (data \ "suitIndex").asOpt[Int]
maybeSuitIndex match {