using System.Collections.Generic; using System.Linq; using System.Text; public partial class GodWeaponConfig : IConfigPostProcess { static Dictionary> m_GodWeaponDict = new Dictionary>(); static Dictionary> m_GodWeaponList = new Dictionary>(); public void OnConfigParseCompleted() { Dictionary dict; if (!m_GodWeaponDict.TryGetValue(Type, out dict)) { dict = new Dictionary(); m_GodWeaponDict.Add(Type, dict); } if (!dict.ContainsKey(Lv)) { dict.Add(Lv, this); } List list = null; if (!m_GodWeaponList.TryGetValue(Type, out list)) { list = new List(); m_GodWeaponList.Add(Type, list); } list.Add(this); } public static GodWeaponConfig GetConfig(int type, int level) { Dictionary dict; if (m_GodWeaponDict.TryGetValue(type, out dict)) { if (dict.ContainsKey(level)) { return dict[level]; } } return null; } public static List GetConfigs(int type) { List list = null; m_GodWeaponList.TryGetValue(type, out list); return list; } public static List GetGodWeaponType() { return m_GodWeaponList.Keys.ToList(); } }