Files
DanhengServer-OpenSource/Common/Data/Excel/BattleEventDataExcel.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

34 lines
833 B
C#

using System.Text.RegularExpressions;
namespace EggLink.DanhengServer.Data.Excel;
[ResourceEntity("BattleEventData.json")]
public partial class BattleEventDataExcel : ExcelResource
{
public int BattleEventID { get; set; }
public string Config { get; set; } = "";
[GeneratedRegex(@"(?<=Avatar_RogueBattleevent)(.*?)(?=_Config.json)")]
private static partial Regex RegexConfig();
public override int GetId()
{
return BattleEventID;
}
public override void Loaded()
{
try
{
var match = RegexConfig().Match(Config);
if (match.Success)
{
var rogueBuffType = int.Parse(match.Value);
GameData.RogueBattleEventData.Add(rogueBuffType, this);
}
}
catch
{
}
}
}