using System.Collections.Generic;
using Mr.BrickAdventures.scripts.Resources;
namespace Mr.BrickAdventures.scripts.State;
///
/// Persistent player data that survives across sessions.
/// This is a POCO (Plain Old C# Object) for predictable state management.
///
public class PlayerState
{
///
/// Saved coins (not including current session).
///
public int Coins { get; set; }
///
/// Remaining lives.
///
public int Lives { get; set; } = 3;
///
/// Indices of completed levels.
///
public List CompletedLevels { get; set; } = new();
///
/// Indices of levels the player can access.
///
public List UnlockedLevels { get; set; } = new() { 0 };
///
/// Skills the player has permanently unlocked.
///
public List UnlockedSkills { get; set; } = new();
///
/// Statistics dictionary for tracking game stats.
///
public Dictionary Statistics { get; set; } = new();
///
/// IDs of unlocked achievements.
///
public List UnlockedAchievements { get; set; } = new();
///
/// Creates a fresh default player state.
///
public static PlayerState CreateDefault() => new()
{
Coins = 0,
Lives = 3,
CompletedLevels = new List(),
UnlockedLevels = new List { 0 },
UnlockedSkills = new List(),
Statistics = new Dictionary()
};
///
/// Resets this state to default values.
///
public void Reset()
{
Coins = 0;
Lives = 3;
CompletedLevels.Clear();
UnlockedLevels.Clear();
UnlockedLevels.Add(0);
UnlockedSkills.Clear();
Statistics.Clear();
}
}