using System.Text.Json.Serialization; namespace Ghost.Editor.Core.Serialization; /// /// Represents the serialized data for a scene in JSON format. /// This is editor-only and used for scene file persistence. /// public class SceneData { /// /// The name of the scene. /// [JsonPropertyName("name")] public string Name { get; set; } = "New Scene"; /// /// List of entities in this scene, ordered by file-local ID. /// The index in this list IS the file-local ID. /// [JsonPropertyName("entities")] public List Entities { get; set; } = []; } /// /// Represents the serialized data for an entity. /// public class EntityData { /// /// The display name of this entity (editor-only). /// [JsonPropertyName("name")] public string Name { get; set; } = "Entity"; /// /// The file-local ID of the parent entity, or -1 if root. /// [JsonPropertyName("parent")] public int ParentLocalId { get; set; } = -1; /// /// Dictionary of component data, keyed by component type name. /// [JsonPropertyName("components")] public Dictionary Components { get; set; } = []; } /// /// Represents the serialized data for a component. /// public class ComponentData { /// /// The component type full name (for deserialization). /// [JsonPropertyName("type")] public string TypeName { get; set; } = ""; /// /// The serialized component fields. /// Entity references are stored as file-local IDs (integers). /// [JsonPropertyName("fields")] public Dictionary Fields { get; set; } = []; }