Skill tree progression system & whitespace support

This commit is contained in:
2026-02-15 07:30:34 +00:00
parent 13550505c1
commit 6d6815af02
22 changed files with 2883 additions and 238 deletions

View File

@@ -1,14 +1,15 @@
use serde::{Deserialize, Serialize};
use crate::engine::key_stats::KeyStatsStore;
use crate::engine::skill_tree::SkillTreeProgress;
use crate::session::result::DrillResult;
const SCHEMA_VERSION: u32 = 1;
const SCHEMA_VERSION: u32 = 2;
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct ProfileData {
pub schema_version: u32,
pub unlocked_letters: Vec<char>,
pub skill_tree: SkillTreeProgress,
pub total_score: f64,
#[serde(alias = "total_lessons")]
pub total_drills: u32,
@@ -21,7 +22,7 @@ impl Default for ProfileData {
fn default() -> Self {
Self {
schema_version: SCHEMA_VERSION,
unlocked_letters: Vec::new(),
skill_tree: SkillTreeProgress::default(),
total_score: 0.0,
total_drills: 0,
streak_days: 0,
@@ -31,6 +32,13 @@ impl Default for ProfileData {
}
}
impl ProfileData {
/// Check if loaded data has a stale schema version and needs reset.
pub fn needs_reset(&self) -> bool {
self.schema_version != SCHEMA_VERSION
}
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct KeyStatsData {
pub schema_version: u32,