Package dev.deepcore.challenge.session
Class PrepReadinessService
java.lang.Object
dev.deepcore.challenge.session.PrepReadinessService
Coordinates prep readiness checks and countdown transitions.
-
Constructor Summary
ConstructorsConstructorDescriptionPrepReadinessService(ChallengeConfigView configView, SessionState sessionState, ParticipantsView participantsView, PrepAreaService prepAreaService, PrepBookService prepBookService, PrepCountdownService prepCountdownService, WorldClassificationService worldClassificationService, DeepCoreLogger log) Creates a prep readiness service. -
Method Summary
Modifier and TypeMethodDescriptionvoidcancelCountdownIfNoPlayersOnline(Set<UUID> participants) Cancels an active countdown when everyone has disconnected.voidtryStartCountdown(Set<UUID> readyPlayers, Set<UUID> participants, BooleanSupplier discoPreviewBlocking, Runnable announceDiscoPreviewBlocked, Runnable startRun) Attempts to start the prep countdown when readiness conditions are met.
-
Constructor Details
-
PrepReadinessService
public PrepReadinessService(ChallengeConfigView configView, SessionState sessionState, ParticipantsView participantsView, PrepAreaService prepAreaService, PrepBookService prepBookService, PrepCountdownService prepCountdownService, WorldClassificationService worldClassificationService, DeepCoreLogger log) Creates a prep readiness service.- Parameters:
configView- typed challenge configuration viewsessionState- mutable session phase and timing stateparticipantsView- online/participant query helperprepAreaService- prep area border serviceprepBookService- prep book inventory serviceprepCountdownService- countdown scheduling serviceworldClassificationService- world classification helperlog- logger used for readiness and countdown messages
-
-
Method Details
-
tryStartCountdown
public void tryStartCountdown(Set<UUID> readyPlayers, Set<UUID> participants, BooleanSupplier discoPreviewBlocking, Runnable announceDiscoPreviewBlocked, Runnable startRun) Attempts to start the prep countdown when readiness conditions are met.- Parameters:
readyPlayers- UUIDs currently marked readyparticipants- mutable participant UUID set for the upcoming rundiscoPreviewBlocking- supplier indicating whether disco preview blocks countdownannounceDiscoPreviewBlocked- action that announces disco preview blockingstartRun- action that starts the run after countdown completion
-
cancelCountdownIfNoPlayersOnline
Cancels an active countdown when everyone has disconnected.- Parameters:
participants- mutable participant UUID set for the pending run
-