//------------------------------------------------------------------------------ // // This code was generated by a tool. // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ using Bright.Serialization; using System.Collections.Generic; using SimpleJSON; namespace cfg.AudioCfg { public sealed partial class Audios { private readonly List _dataList; private Dictionary _dataMap_ID; private Dictionary _dataMap_Key; public Audios(JSONNode _json) { _dataList = new List(); foreach(JSONNode _row in _json.Children) { var _v = AudioCfg.DataAudio.DeserializeDataAudio(_row); _dataList.Add(_v); } _dataMap_ID = new Dictionary(); _dataMap_Key = new Dictionary(); foreach(var _v in _dataList) { _dataMap_ID.Add(_v.ID, _v); _dataMap_Key.Add(_v.Key, _v); } PostInit(); } public List DataList => _dataList; public AudioCfg.DataAudio GetByID(int key) => _dataMap_ID.TryGetValue(key, out AudioCfg.DataAudio __v) ? __v : null; public AudioCfg.DataAudio GetByKey(string key) => _dataMap_Key.TryGetValue(key, out AudioCfg.DataAudio __v) ? __v : null; public void Resolve(Dictionary _tables) { foreach(var v in _dataList) { v.Resolve(_tables); } PostResolve(); } public void TranslateText(System.Func translator) { foreach(var v in _dataList) { v.TranslateText(translator); } } partial void PostInit(); partial void PostResolve(); } }