Files
DanhengServer-OpenSource/Common/Data/Config/LevelGraphConfigInfo.cs
Somebody 87d228eb79 Feature:Asynchronous Operation & Formatting Code
- Now the async operation is enabled!
- Code formatted by Resharper plugin <3
2024-07-22 17:12:03 +08:00

21 lines
869 B
C#

using Newtonsoft.Json.Linq;
namespace EggLink.DanhengServer.Data.Config;
public class LevelGraphConfigInfo
{
public List<LevelInitSequeceConfigInfo> OnInitSequece { get; set; } = [];
public List<LevelStartSequeceConfigInfo> OnStartSequece { get; set; } = [];
public static LevelGraphConfigInfo LoadFromJsonObject(JObject obj)
{
LevelGraphConfigInfo info = new();
if (obj.ContainsKey(nameof(OnInitSequece)))
info.OnInitSequece = obj[nameof(OnInitSequece)]
?.Select(x => LevelInitSequeceConfigInfo.LoadFromJsonObject((x as JObject)!)).ToList() ?? [];
if (obj.ContainsKey(nameof(OnStartSequece)))
info.OnStartSequece = obj[nameof(OnStartSequece)]
?.Select(x => LevelStartSequeceConfigInfo.LoadFromJsonObject((x as JObject)!)).ToList() ?? [];
return info;
}
}