feat(ui): enhance user session management with interaction reset and locking

This commit is contained in:
2025-11-02 16:50:51 +01:00
parent 325f2e44f6
commit 8eec1fd38f
3 changed files with 27 additions and 4 deletions

View File

@@ -111,6 +111,7 @@ class GameLobby private(
if (!PlayerUtil.canPlayCard(card, getRound, getTrick, player)) {
throw new CantPlayCardException("You can't play this card!")
}
userSession.resetCanInteract()
logic.playerInputLogic.receivedCard(card)
}
@@ -132,6 +133,7 @@ class GameLobby private(
}
val hand = getHand(player)
val card = hand.cards(cardIndex)
userSession.resetCanInteract()
logic.playerInputLogic.receivedDog(Some(card))
}
@@ -144,6 +146,7 @@ class GameLobby private(
val player = getPlayerInteractable(userSession, InteractionType.TrumpSuit)
val trumpSuits = Suit.values.toList
val selectedTrump = trumpSuits(trumpIndex)
userSession.resetCanInteract()
logic.playerInputLogic.receivedTrumpSuit(selectedTrump)
}
@@ -154,6 +157,7 @@ class GameLobby private(
*/
def selectTie(userSession: UserSession, tieNumber: Int): Unit = {
val player = getPlayerInteractable(userSession, InteractionType.TieChoice)
userSession.resetCanInteract()
logic.playerTieLogic.receivedTieBreakerCard(tieNumber)
}