Refactor game logic to track player input state; add CardPlayedEvent and update RoundEndEvent with trick count

This commit is contained in:
2025-10-19 20:48:46 +02:00
parent dad604186e
commit 3357fb7310
3 changed files with 17 additions and 16 deletions

View File

@@ -3,14 +3,15 @@ package controllers
import controllers.sessions.SimpleSession
import de.knockoutwhist.cards.{Card, CardValue, Hand, Suit}
import de.knockoutwhist.events.*
import de.knockoutwhist.events.ERROR_STATUS.*
import de.knockoutwhist.events.GLOBAL_STATUS.*
import de.knockoutwhist.events.PLAYER_STATUS.*
import de.knockoutwhist.events.ROUND_STATUS.{PLAYERS_OUT, SHOW_START_ROUND, WON_ROUND}
import de.knockoutwhist.events.cards.{RenderHandEvent, ShowTieCardsEvent}
import de.knockoutwhist.events.round.ShowCurrentTrickEvent
import de.knockoutwhist.events.ui.GameState.{INGAME, MAIN_MENU}
import de.knockoutwhist.events.ui.{GameState, GameStateUpdateEvent}
import de.knockoutwhist.events.old.ERROR_STATUS.*
import de.knockoutwhist.events.old.GLOBAL_STATUS.*
import de.knockoutwhist.events.old.PLAYER_STATUS.*
import de.knockoutwhist.events.old.ROUND_STATUS.{PLAYERS_OUT, SHOW_START_ROUND, WON_ROUND}
import de.knockoutwhist.events.old.{ShowErrorStatus, ShowGlobalStatus, ShowPlayerStatus, ShowRoundStatus}
import de.knockoutwhist.events.old.cards.{RenderHandEvent, ShowTieCardsEvent}
import de.knockoutwhist.events.old.round.ShowCurrentTrickEvent
import de.knockoutwhist.events.old.ui.{GameState, GameStateUpdateEvent}
import de.knockoutwhist.events.old.ui.GameState.{INGAME, MAIN_MENU}
import de.knockoutwhist.player.AbstractPlayer
import de.knockoutwhist.rounds.Match
import de.knockoutwhist.ui.UI

View File

@@ -1,13 +1,13 @@
package controllers.sessions
import de.knockoutwhist.cards.{Card, CardValue, Hand}
import de.knockoutwhist.events.ERROR_STATUS.*
import de.knockoutwhist.events.GLOBAL_STATUS.*
import de.knockoutwhist.events.PLAYER_STATUS.*
import de.knockoutwhist.events.ROUND_STATUS.*
import de.knockoutwhist.events.{ShowErrorStatus, ShowGlobalStatus, ShowPlayerStatus, ShowRoundStatus}
import de.knockoutwhist.events.cards.{RenderHandEvent, ShowTieCardsEvent}
import de.knockoutwhist.events.round.ShowCurrentTrickEvent
import de.knockoutwhist.events.old.ERROR_STATUS.*
import de.knockoutwhist.events.old.GLOBAL_STATUS.*
import de.knockoutwhist.events.old.PLAYER_STATUS.*
import de.knockoutwhist.events.old.ROUND_STATUS.*
import de.knockoutwhist.events.old.{ShowErrorStatus, ShowGlobalStatus, ShowPlayerStatus, ShowRoundStatus}
import de.knockoutwhist.events.old.cards.{RenderHandEvent, ShowTieCardsEvent}
import de.knockoutwhist.events.old.round.ShowCurrentTrickEvent
import de.knockoutwhist.player.AbstractPlayer
import de.knockoutwhist.utils.events.SimpleEvent
import play.twirl.api.Html