Phase2.1 添加武器tag配置和数据表定义

This commit is contained in:
2026-09-27 18:21:26 +08:00
parent 4ac79f0101
commit e0488cc790
47 changed files with 1249 additions and 169 deletions
@@ -17,12 +17,12 @@ namespace SepCore.Definition
/// </summary>
public partial class TbWeaponConfig
{
private readonly System.Collections.Generic.Dictionary<WeaponType, WeaponConfig> _dataMap;
private readonly System.Collections.Generic.Dictionary<int, WeaponConfig> _dataMap;
private readonly System.Collections.Generic.List<WeaponConfig> _dataList;
public TbWeaponConfig(ByteBuf _buf)
{
_dataMap = new System.Collections.Generic.Dictionary<WeaponType, WeaponConfig>();
_dataMap = new System.Collections.Generic.Dictionary<int, WeaponConfig>();
_dataList = new System.Collections.Generic.List<WeaponConfig>();
for(int n = _buf.ReadSize() ; n > 0 ; --n)
@@ -30,16 +30,16 @@ public partial class TbWeaponConfig
WeaponConfig _v;
_v = WeaponConfig.DeserializeWeaponConfig(_buf);
_dataList.Add(_v);
_dataMap.Add(_v.WeaponType, _v);
_dataMap.Add(_v.Id, _v);
}
}
public System.Collections.Generic.Dictionary<WeaponType, WeaponConfig> DataMap => _dataMap;
public System.Collections.Generic.Dictionary<int, WeaponConfig> DataMap => _dataMap;
public System.Collections.Generic.List<WeaponConfig> DataList => _dataList;
public WeaponConfig GetOrDefault(WeaponType key) => _dataMap.TryGetValue(key, out var v) ? v : null;
public WeaponConfig Get(WeaponType key) => _dataMap[key];
public WeaponConfig this[WeaponType key] => _dataMap[key];
public WeaponConfig GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
public WeaponConfig Get(int key) => _dataMap[key];
public WeaponConfig this[int key] => _dataMap[key];
public void ResolveRef(Tables tables)
{