Class ChallengeAdminFacade

java.lang.Object
dev.deepcore.challenge.ChallengeAdminFacade

public final class ChallengeAdminFacade extends Object
Facade for challenge command orchestration across manager/session/world flows.
  • Constructor Details

    • ChallengeAdminFacade

      public ChallengeAdminFacade(DeepCorePlugin plugin, ChallengeManager challengeManager, ChallengeSessionManager challengeSessionManager, WorldResetManager worldResetManager, DeepCoreLogger logger)
      Creates an admin facade wiring challenge manager, session, and world reset services.
      Parameters:
      plugin - plugin instance used for config operations
      challengeManager - challenge configuration manager
      challengeSessionManager - session lifecycle coordinator
      worldResetManager - world reset orchestration service
      logger - logger used for command and config operations
  • Method Details

    • canEditSettings

      public boolean canEditSettings()
      Returns whether challenge settings can currently be edited.
      Returns:
      true when session state allows settings modifications
    • setEnabled

      public void setEnabled(boolean enabled)
      Enables or disables challenge mode and reapplies world rules.
      Parameters:
      enabled - true to enable challenge mode, false to disable it
    • setMode

      public void setMode(ChallengeMode mode)
      Sets the active challenge mode and reapplies dependent state.
      Parameters:
      mode - challenge mode to activate
    • resetComponentsToModeDefaults

      public void resetComponentsToModeDefaults()
      Resets component toggles to defaults of the active mode.
    • applyComponentOperation

      public void applyComponentOperation(ChallengeComponent component, String operation)
      Applies a component operation (`on`, `off`, or `toggle`).
      Parameters:
      component - challenge component to mutate
      operation - requested operation name
      Throws:
      IllegalArgumentException - when operation is not one of on/off/toggle
    • isPrepPhase

      public boolean isPrepPhase()
      Returns whether the session is currently in prep phase.
      Returns:
      true when the challenge session is in prep phase
    • isRunningPhase

      public boolean isRunningPhase()
      Returns whether the session is currently in running phase.
      Returns:
      true when the challenge session is actively running
    • isPausedPhase

      public boolean isPausedPhase()
      Returns whether the session is currently in paused phase.
      Returns:
      true when the challenge session is paused
    • endChallengeAndReturnToPrep

      public void endChallengeAndReturnToPrep()
      Ends an active challenge and transitions back to prep state.
    • stopChallenge

      public void stopChallenge(org.bukkit.command.CommandSender sender)
      Stops challenge flow and triggers a world reset.
      Parameters:
      sender - command sender requesting the stop action
    • pauseChallenge

      public boolean pauseChallenge(org.bukkit.command.CommandSender sender)
      Attempts to pause the active challenge run.
      Parameters:
      sender - command sender requesting pause
      Returns:
      true when pause was accepted and applied
    • resumeChallenge

      public boolean resumeChallenge(org.bukkit.command.CommandSender sender)
      Attempts to resume a paused challenge run.
      Parameters:
      sender - command sender requesting resume
      Returns:
      true when resume was accepted and applied
    • resetWorlds

      public void resetWorlds(org.bukkit.command.CommandSender sender)
      Triggers an immediate world reset.
      Parameters:
      sender - command sender requesting world reset
    • reloadConfigAndApply

      public boolean reloadConfigAndApply()
      Reloads config and applies settings immediately when in prep phase.
      Returns:
      true when reload and apply were fully completed
    • isChallengeEnabled

      public boolean isChallengeEnabled()
      Returns whether challenge mode is enabled.
      Returns:
      true when challenge mode is currently enabled
    • getPhaseName

      public String getPhaseName()
      Returns the current session phase name.
      Returns:
      lowercase session phase name
    • getReadyCount

      public int getReadyCount()
      Returns current ready player count.
      Returns:
      number of participants currently marked ready
    • getReadyTargetCount

      public int getReadyTargetCount()
      Returns current ready target count.
      Returns:
      number of participants required for ready completion
    • getMode

      public ChallengeMode getMode()
      Returns the active challenge mode.
      Returns:
      currently configured challenge mode
    • getComponentToggles

      public Map<ChallengeComponent,Boolean> getComponentToggles()
      Returns current component toggle values.
      Returns:
      map of each challenge component and its enabled state
    • isComponentEnabled

      public boolean isComponentEnabled(ChallengeComponent component)
      Returns whether a specific challenge component is enabled.
      Parameters:
      component - component to query
      Returns:
      true when the requested component is enabled