Package dev.deepcore.challenge.training
Class TrainingStatsStore
java.lang.Object
dev.deepcore.challenge.training.TrainingStatsStore
Persists per-player training challenge times and recent attempt history.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordImmutable per-player stats for one challenge. -
Constructor Summary
ConstructorsConstructorDescriptionTrainingStatsStore(org.bukkit.plugin.java.JavaPlugin plugin) Creates a stats store rooted in the plugin data directory. -
Method Summary
Modifier and TypeMethodDescriptiongetStats(UUID playerId, TrainingChallengeType type) Returns immutable stats snapshot for one player/challenge.voidload()Loads all persisted stats into memory.voidrecordCompletedAttempt(UUID playerId, TrainingChallengeType type, long elapsedMs) Records a completed attempt time for one player and challenge type.voidsave()Saves the in-memory stats map to disk.
-
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
Records a completed attempt time for one player and challenge type.- Parameters:
playerId- player UUIDtype- challenge typeelapsedMs- completed elapsed time in milliseconds
-
getStats
Returns immutable stats snapshot for one player/challenge.- Parameters:
playerId- player UUIDtype- challenge type- Returns:
- stats snapshot; empty values when no attempts exist
-