refactor: enhance GameStateStore integration and improve skill management
This commit is contained in:
@@ -16,7 +16,7 @@ public partial class SaveSystem : Node
|
||||
|
||||
public static SaveSystem Instance { get; private set; }
|
||||
|
||||
private static readonly JsonSerializerOptions JsonOptions = new()
|
||||
internal static readonly JsonSerializerOptions JsonOptions = new()
|
||||
{
|
||||
WriteIndented = true,
|
||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase
|
||||
@@ -47,7 +47,7 @@ public partial class SaveSystem : Node
|
||||
Version = Version,
|
||||
Coins = store.Player.Coins,
|
||||
Lives = store.Player.Lives,
|
||||
CurrentLevel = store.Session.CurrentLevel,
|
||||
CurrentLevel = store.Player.CurrentLevel,
|
||||
CompletedLevels = [.. store.Player.CompletedLevels],
|
||||
UnlockedLevels = new List<int>(store.Player.UnlockedLevels),
|
||||
UnlockedSkillNames = GetSkillNames(store.Player.UnlockedSkills),
|
||||
@@ -105,7 +105,7 @@ public partial class SaveSystem : Node
|
||||
// Apply loaded state
|
||||
store.Player.Coins = saveData.Coins;
|
||||
store.Player.Lives = saveData.Lives;
|
||||
store.Session.CurrentLevel = saveData.CurrentLevel;
|
||||
store.Player.CurrentLevel = saveData.CurrentLevel;
|
||||
|
||||
store.Player.CompletedLevels = saveData.CompletedLevels ?? new List<int>();
|
||||
store.Player.UnlockedLevels = saveData.UnlockedLevels ?? new List<int> { 0 };
|
||||
|
||||
Reference in New Issue
Block a user