using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
|
namespace TableConfig
|
{
|
public partial class GodWeaponConfig : ConfigBase, IConfigPostProcess
|
{
|
private static Dictionary<string, GodWeaponConfig> m_GodWeaponCfgs = new Dictionary<string, GodWeaponConfig>();
|
|
private static Dictionary<int, List<GodWeaponConfig>> m_GodWeaponList = new Dictionary<int, List<GodWeaponConfig>>();
|
|
public void OnConfigParseCompleted()
|
{
|
m_GodWeaponCfgs.Add(StringUtility.Contact(Type, Lv).ToString(), this);
|
|
List<GodWeaponConfig> list = null;
|
m_GodWeaponList.TryGetValue(Type, out list);
|
if (list == null)
|
{
|
list = new List<GodWeaponConfig>();
|
list.Add(this);
|
m_GodWeaponList.Add(Type, list);
|
}
|
else
|
{
|
list.Add(this);
|
}
|
}
|
|
public static GodWeaponConfig GetGodWeaponCfgByTypeLv(int type, int lv)
|
{
|
GodWeaponConfig cfg = null;
|
m_GodWeaponCfgs.TryGetValue(StringUtility.Contact(type, lv), out cfg);
|
return cfg;
|
}
|
|
public static List<GodWeaponConfig> GetGodWeaponCfgByType(int type)
|
{
|
List<GodWeaponConfig> list = null;
|
m_GodWeaponList.TryGetValue(type, out list);
|
return list;
|
}
|
|
public static List<int> GetGodWeaponType()
|
{
|
return m_GodWeaponList.Keys.ToList();
|
}
|
}
|
}
|