//------------------------------------------------------------------------------ // // 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; namespace Cfg.Config { public partial class TbTestMap { private readonly Dictionary _dataMap; private readonly List _dataList; public TbTestMap(ByteBuf _buf) { _dataMap = new Dictionary(); _dataList = new List(); for(int n = _buf.ReadSize() ; n > 0 ; --n) { Config.TestData _v; _v = Config.TestData.DeserializeTestData(_buf); _dataList.Add(_v); _dataMap.Add(_v.Id, _v); } PostInit(); } public Dictionary DataMap => _dataMap; public List DataList => _dataList; public Config.TestData GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null; public Config.TestData Get(int key) => _dataMap[key]; public Config.TestData this[int key] => _dataMap[key]; 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(); } }