//------------------------------------------------------------------------------ // // 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 Luban; using SimpleJSON; namespace cfg.data { public partial class TbLanguage { private readonly System.Collections.Generic.List _dataList; private System.Collections.Generic.Dictionary _dataMap_key1; private System.Collections.Generic.Dictionary _dataMap_key2; public TbLanguage(JSONNode _buf) { _dataList = new System.Collections.Generic.List(); foreach(JSONNode _ele in _buf.Children) { data.Language _v; { if(!_ele.IsObject) { throw new SerializationException(); } _v = data.Language.DeserializeLanguage(_ele); } _dataList.Add(_v); } _dataMap_key1 = new System.Collections.Generic.Dictionary(); _dataMap_key2 = new System.Collections.Generic.Dictionary(); foreach(var _v in _dataList) { _dataMap_key1.Add(_v.Key1, _v); _dataMap_key2.Add(_v.Key2, _v); } } public System.Collections.Generic.List DataList => _dataList; public data.Language GetByKey1(int key) => _dataMap_key1.TryGetValue(key, out data.Language __v) ? __v : null; public data.Language GetByKey2(string key) => _dataMap_key2.TryGetValue(key, out data.Language __v) ? __v : null; public void ResolveRef(Tables tables) { foreach(var _v in _dataList) { _v.ResolveRef(tables); } } } }