Files
TEngine/DotNet/Logic/src/Config/GameConfig/Battle/TbBuff.cs
ALEXTANG d4f160d284 合理化程序集,服务器Logic无需共享的代码存放解决方案目录,无需走Unity目录
合理化程序集,服务器Logic无需共享的代码存放解决方案目录,无需走Unity目录
2023-07-15 18:39:42 +08:00

63 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;
namespace GameConfig.Battle
{
public partial class TbBuff
{
private readonly Dictionary<int, Battle.BuffConfig> _dataMap;
private readonly List<Battle.BuffConfig> _dataList;
public TbBuff(ByteBuf _buf)
{
_dataMap = new Dictionary<int, Battle.BuffConfig>();
_dataList = new List<Battle.BuffConfig>();
for(int n = _buf.ReadSize() ; n > 0 ; --n)
{
Battle.BuffConfig _v;
_v = Battle.BuffConfig.DeserializeBuffConfig(_buf);
_dataList.Add(_v);
_dataMap.Add(_v.BuffID, _v);
}
PostInit();
}
public Dictionary<int, Battle.BuffConfig> DataMap => _dataMap;
public List<Battle.BuffConfig> DataList => _dataList;
public Battle.BuffConfig GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
public Battle.BuffConfig Get(int key) => _dataMap[key];
public Battle.BuffConfig 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();
}
}