Feature:Asynchronous Operation & Formatting Code

- Now the async operation is enabled!
- Code formatted by Resharper plugin <3
This commit is contained in:
Somebody
2024-07-22 17:12:03 +08:00
parent e983375620
commit 87d228eb79
793 changed files with 34764 additions and 40190 deletions

View File

@@ -1,29 +1,21 @@
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
namespace EggLink.DanhengServer.Data.Config;
public class LevelGraphConfigInfo
{
public class LevelGraphConfigInfo
{
public List<LevelInitSequeceConfigInfo> OnInitSequece { get; set; } = [];
public List<LevelStartSequeceConfigInfo> OnStartSequece { get; set; } = [];
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;
}
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;
}
}
}