NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/DataTable/UIInterfaceBannerGoToCfg/bannerCfg.cs

72 lines
2.2 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 cfg.UIInterfaceBannerGoToCfg
{
public sealed partial class bannerCfg
{
private readonly Dictionary<int, UIInterfaceBannerGoToCfg.DataUIBanner> _dataMap;
private readonly List<UIInterfaceBannerGoToCfg.DataUIBanner> _dataList;
public bannerCfg(JSONNode _json)
{
_dataMap = new Dictionary<int, UIInterfaceBannerGoToCfg.DataUIBanner>();
_dataList = new List<UIInterfaceBannerGoToCfg.DataUIBanner>();
foreach(JSONNode _row in _json.Children)
{
var _v = UIInterfaceBannerGoToCfg.DataUIBanner.DeserializeDataUIBanner(_row);
_dataList.Add(_v);
_dataMap.Add(_v.Index, _v);
}
PostInit();
}
public Dictionary<int, UIInterfaceBannerGoToCfg.DataUIBanner> DataMap => _dataMap;
public List<UIInterfaceBannerGoToCfg.DataUIBanner> DataList => _dataList;
public UIInterfaceBannerGoToCfg.DataUIBanner GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
public UIInterfaceBannerGoToCfg.DataUIBanner Get(int key) {
if (_dataMap.TryGetValue(key, out var v)) {
return v;
} else {
UnityEngine.Debug.LogError($"table bannerCfg key not found: {key}");
return null;
}
}
public UIInterfaceBannerGoToCfg.DataUIBanner 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();
}
}