mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
65 lines
1.8 KiB
C#
65 lines
1.8 KiB
C#
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was generated by a tool.
|
|
// Changes to this file may cause incorrect behavior and will be lost if
|
|
// the code is regenerated.
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
using Bright.Serialization;
|
|
using System.Collections.Generic;
|
|
using SimpleJSON;
|
|
|
|
|
|
|
|
namespace GameConfig.Battle
|
|
{
|
|
|
|
public sealed partial class TbBuffAttr
|
|
{
|
|
private readonly Dictionary<int, Battle.BuffAttrConfig> _dataMap;
|
|
private readonly List<Battle.BuffAttrConfig> _dataList;
|
|
|
|
public TbBuffAttr(JSONNode _json)
|
|
{
|
|
_dataMap = new Dictionary<int, Battle.BuffAttrConfig>();
|
|
_dataList = new List<Battle.BuffAttrConfig>();
|
|
|
|
foreach(JSONNode _row in _json.Children)
|
|
{
|
|
var _v = Battle.BuffAttrConfig.DeserializeBuffAttrConfig(_row);
|
|
_dataList.Add(_v);
|
|
_dataMap.Add(_v.BuffID, _v);
|
|
}
|
|
PostInit();
|
|
}
|
|
|
|
public Dictionary<int, Battle.BuffAttrConfig> DataMap => _dataMap;
|
|
public List<Battle.BuffAttrConfig> DataList => _dataList;
|
|
|
|
public Battle.BuffAttrConfig GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
|
|
public Battle.BuffAttrConfig Get(int key) => _dataMap[key];
|
|
public Battle.BuffAttrConfig this[int key] => _dataMap[key];
|
|
|
|
public void Resolve(Dictionary<string, object> _tables)
|
|
{
|
|
foreach(var v in _dataList)
|
|
{
|
|
v.Resolve(_tables);
|
|
}
|
|
PostResolve();
|
|
}
|
|
|
|
public void TranslateText(System.Func<string, string, string> translator)
|
|
{
|
|
foreach(var v in _dataList)
|
|
{
|
|
v.TranslateText(translator);
|
|
}
|
|
}
|
|
|
|
|
|
partial void PostInit();
|
|
partial void PostResolve();
|
|
}
|
|
|
|
} |