feat(engine): add ProgressPlugin awarding XP on wins with level-up events

On GameWonEvent, computes xp_for_win(time, used_undo) from
solitaire_data, calls PlayerProgress::add_xp, and emits LevelUpEvent
when the level changes. Persists atomically through the configurable
storage path; ProgressPlugin::headless() disables I/O for tests.

Introduces ProgressUpdate system set so future systems can run after
progress mutations.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-04-24 19:11:22 -07:00
parent cfdb3b7547
commit ef043c14d4
3 changed files with 213 additions and 2 deletions
+3 -2
View File
@@ -1,7 +1,7 @@
use bevy::prelude::*;
use solitaire_engine::{
AchievementPlugin, AnimationPlugin, CardPlugin, GamePlugin, InputPlugin, StatsPlugin,
TablePlugin,
AchievementPlugin, AnimationPlugin, CardPlugin, GamePlugin, InputPlugin, ProgressPlugin,
StatsPlugin, TablePlugin,
};
fn main() {
@@ -23,5 +23,6 @@ fn main() {
.add_plugins(AnimationPlugin)
.add_plugins(StatsPlugin::default())
.add_plugins(AchievementPlugin::default())
.add_plugins(ProgressPlugin::default())
.run();
}