using Godot; namespace Mr.BrickAdventures.scripts.Resources; /// /// One authored Level: its stable id, its display name key, and where its scene lives. /// /// /// /// is what Playthroughs and Best Times reference, so it must never change once a /// build has shipped — unlike position in a list, which is what the old GameManager.LevelScenes /// array used and which every save depended on. /// /// /// is deliberately a path string and not an exported PackedScene. /// Several level scenes reference their own LevelResource (for the death screen's label), so a /// typed reference back to the scene forms a cycle that Godot cannot resolve — it fails with /// "Parse Error: Busy" and the level will not load at all. /// /// /// The trade-off is that a path can rot: this field previously pointed at /// res://scenes/level_forest_5.tscn, which does not exist. That is fixed by validation rather /// than by typing — LevelCatalogue.Validate checks every path resolves, so a bad one fails /// loudly at boot instead of silently. /// /// [GlobalClass] public partial class LevelResource : Resource { /// Stable identity. Referenced by saves — do not change after shipping. [Export] public string Id { get; set; } = string.Empty; /// Translation key for the player-facing name. Labels auto-translate it. [Export] public string LevelName { get; set; } = string.Empty; /// /// res:// or uid:// path to the scene. Loaded on demand, never held as a typed /// reference — see the remarks above. /// [Export(PropertyHint.File, "*.tscn")] public string ScenePath { get; set; } = string.Empty; }