调整部分数据表配置,优化 SpriteCache 功能
This commit is contained in:
@@ -17,12 +17,12 @@ namespace SepCore.Definition
|
||||
/// </summary>
|
||||
public partial class TbWeaponConfig
|
||||
{
|
||||
private readonly System.Collections.Generic.Dictionary<int, WeaponConfig> _dataMap;
|
||||
private readonly System.Collections.Generic.Dictionary<WeaponType, WeaponConfig> _dataMap;
|
||||
private readonly System.Collections.Generic.List<WeaponConfig> _dataList;
|
||||
|
||||
public TbWeaponConfig(ByteBuf _buf)
|
||||
{
|
||||
_dataMap = new System.Collections.Generic.Dictionary<int, WeaponConfig>();
|
||||
_dataMap = new System.Collections.Generic.Dictionary<WeaponType, 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.Id, _v);
|
||||
_dataMap.Add(_v.WeaponType, _v);
|
||||
}
|
||||
}
|
||||
|
||||
public System.Collections.Generic.Dictionary<int, WeaponConfig> DataMap => _dataMap;
|
||||
public System.Collections.Generic.Dictionary<WeaponType, WeaponConfig> DataMap => _dataMap;
|
||||
public System.Collections.Generic.List<WeaponConfig> DataList => _dataList;
|
||||
|
||||
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 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 void ResolveRef(Tables tables)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user