mirror of
https://github.com/EggLinks/DanhengServer-OpenSource.git
synced 2026-01-03 04:36:03 +08:00
100 lines
3.3 KiB
C#
100 lines
3.3 KiB
C#
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<int, Dictionary<int, List<ScenePropData>>> ScenePropData { get; set; } =
|
|
[]; // Dictionary<FloorId, Dictionary<GroupId, ScenePropData>>
|
|
|
|
[SugarColumn(IsJson = true)]
|
|
public Dictionary<int, List<int>> UnlockSectionIdList { get; set; } = []; // Dictionary<FloorId, List<SectionId>>
|
|
|
|
[SugarColumn(IsJson = true)]
|
|
public Dictionary<int, Dictionary<int, string>> CustomSaveData { get; set; } =
|
|
[]; // Dictionary<EntryId, Dictionary<GroupId, SaveData>>
|
|
|
|
[SugarColumn(IsJson = true)]
|
|
public Dictionary<int, Dictionary<string, int>> FloorSavedData { get; set; } =
|
|
[]; // Dictionary<FloorId, Dictionary<SaveDataKey, SaveDataValue>>
|
|
|
|
[SugarColumn(IsJson = true, ColumnDataType = "TEXT")]
|
|
public Dictionary<int, Dictionary<int, Dictionary<int, ScenePropTimelineData>>> PropTimelineData { get; set; } =
|
|
[]; // Dictionary<FloorId, Dictionary<GroupId, Dictionary<PropId, ScenePropTimelineData>>>
|
|
|
|
[SugarColumn(IsJson = true, ColumnDataType = "TEXT")]
|
|
public Dictionary<int, List<SceneMarkedChestData>> MarkedChestData { get; set; } =
|
|
[]; // Dictionary<FuncId, List<ScenePropTimelineData>>
|
|
|
|
[SugarColumn(IsJson = true, ColumnDataType = "TEXT")]
|
|
public Dictionary<int, Dictionary<int, Dictionary<string, int>>> GroupPropertyData { get; set; } =
|
|
[]; // Dictionary<FloorId, Dictionary<GroupId, Dictionary<Key, Value>>>
|
|
|
|
[SugarColumn(IsJson = true, ColumnDataType = "TEXT")]
|
|
public SceneEraFlipperData EraFlipperData { get; set; } = new();
|
|
|
|
[SugarColumn(IsJson = true, ColumnDataType = "TEXT")]
|
|
public SceneRotatableRegionData RotatableRegionData { get; set; } = new();
|
|
|
|
[SugarColumn(IsJson = true, ColumnDataType = "TEXT")]
|
|
public Dictionary<int, int> FloorTargetPuzzleGroupData { get; set; } = new();
|
|
}
|
|
|
|
public class ScenePropData
|
|
{
|
|
public int PropId { get; set; }
|
|
public PropStateEnum State { get; set; }
|
|
}
|
|
|
|
public class SceneEraFlipperData
|
|
{
|
|
public int CurRegionId { get; set; }
|
|
public Dictionary<int, int> RegionState { get; set; } = []; // Dictionary<RegionId, State>
|
|
}
|
|
|
|
public class SceneRotatableRegionData
|
|
{
|
|
public int CurRegionId { get; set; }
|
|
public int Energy { get; set; }
|
|
public int MaxEnergy { get; set; }
|
|
public int RotateValue { 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
|
|
};
|
|
}
|
|
} |