Class TrainingStatsStore

java.lang.Object
dev.deepcore.challenge.training.TrainingStatsStore

public final class TrainingStatsStore extends Object
Persists per-player training challenge times and recent attempt history.
  • Constructor Details

    • TrainingStatsStore

      public TrainingStatsStore(org.bukkit.plugin.java.JavaPlugin plugin)
      Creates a stats store rooted in the plugin data directory.
      Parameters:
      plugin - plugin instance owning this store
  • Method Details

    • load

      public void load()
      Loads all persisted stats into memory.
    • save

      public void save()
      Saves the in-memory stats map to disk.
    • recordCompletedAttempt

      public void recordCompletedAttempt(UUID playerId, TrainingChallengeType type, long elapsedMs)
      Records a completed attempt time for one player and challenge type.
      Parameters:
      playerId - player UUID
      type - challenge type
      elapsedMs - completed elapsed time in milliseconds
    • getStats

      Returns immutable stats snapshot for one player/challenge.
      Parameters:
      playerId - player UUID
      type - challenge type
      Returns:
      stats snapshot; empty values when no attempts exist