using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace DataServer.Data.Entities; /// /// Persisted dungeon data for dungeons that become inactive but remain "open" /// [Table("dungeon_instances")] public class DungeonPersistence { [Key] public Guid Id { get; set; } public int Tier { get; set; } public int Seed { get; set; } // Level bracket public int LevelBracketMin { get; set; } public int LevelBracketMax { get; set; } // Creator info public ulong CreatorCharacterId { get; set; } public string CreatorName { get; set; } = ""; public int CreatorLevel { get; set; } // Timestamps public DateTime CreatedAt { get; set; } public DateTime LastActivity { get; set; } public DateTime? PersistedAt { get; set; } // State public bool BossKilled { get; set; } = false; public bool IsCleared { get; set; } = false; /// /// Serialized mob state (JSON) - only alive mobs with their positions/health /// [Column(TypeName = "json")] public string? MobStateJson { get; set; } /// /// Serialized chest state (JSON) - which chests are opened /// [Column(TypeName = "json")] public string? ChestStateJson { get; set; } /// /// Serialized loot chest state (JSON) - personal loot chests /// [Column(TypeName = "json")] public string? LootChestStateJson { get; set; } // Navigation public virtual DungeonCharacter? Creator { get; set; } } /// /// Serializable mob state for persistence /// public class PersistedMobState { public int Id { get; set; } public int DefinitionId { get; set; } public float X { get; set; } public float Y { get; set; } public int Health { get; set; } public bool IsAlive { get; set; } } /// /// Wrapper payload for persisted dungeon mob state and runtime metadata. /// public class PersistedDungeonMobPayload { public bool BossesRespawnOnReload { get; set; } = false; public List Mobs { get; set; } = new(); } /// /// Serializable chest state for persistence /// public class PersistedChestState { public int Id { get; set; } public bool IsOpened { get; set; } }