Files
DanhengServer-OpenSource/Common/Data/Config/LevelGraphConfigInfo.cs
Somebody 72ddae8940 [BREAK CHANGE] Feature: Implement the basic task system
- Support for the 2.0&2.1 mission
- The story line is still not working
2024-07-16 14:15:07 +08:00

30 lines
1.0 KiB
C#

using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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;
}
}
}