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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user