using EggLink.DanhengServer.Enums.Scene; using EggLink.DanhengServer.Proto; using Google.Protobuf; using SqlSugar; namespace EggLink.DanhengServer.Database.Scene; [SugarTable("Scene")] public class SceneData : BaseDatabaseDataHelper { [SugarColumn(IsJson = true, ColumnDataType = "TEXT")] public Dictionary>> ScenePropData { get; set; } = []; // Dictionary> [SugarColumn(IsJson = true)] public Dictionary> UnlockSectionIdList { get; set; } = []; // Dictionary> [SugarColumn(IsJson = true)] public Dictionary> CustomSaveData { get; set; } = []; // Dictionary> [SugarColumn(IsJson = true)] public Dictionary> FloorSavedData { get; set; } = []; // Dictionary> [SugarColumn(IsJson = true, ColumnDataType = "TEXT")] public Dictionary>> PropTimelineData { get; set; } = []; // Dictionary>> [SugarColumn(IsJson = true, ColumnDataType = "TEXT")] public Dictionary> MarkedChestData { get; set; } = []; // Dictionary> } public class ScenePropData { public int PropId { get; set; } public PropStateEnum State { get; set; } } public class ScenePropTimelineData { public bool BoolValue { get; set; } public string ByteValue { get; set; } = ""; // Base64 public PropTimelineInfo ToProto() { return new PropTimelineInfo { TimelineBoolValue = BoolValue, TimelineByteValue = ByteString.FromBase64(ByteValue) }; } } public class SceneMarkedChestData { public int ConfigId { get; set; } public int GroupId { get; set; } public int FloorId { get; set; } public int PlaneId { get; set; } public MarkChestInfo ToProto() { return new MarkChestInfo { ConfigId = (uint)ConfigId, FloorId = (uint)FloorId, GroupId = (uint)GroupId, PlaneId = (uint)PlaneId }; } }