少年修仙传客户端代码仓库
Client_PangDeRong
2018-12-04 bd00a167463567c700a2da2c489805d4c26aaa7f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace TableConfig
{
    public partial class GodWeaponConfig : ConfigBase, IConfigPostProcess
    {
        static Dictionary<int, Dictionary<int, GodWeaponConfig>> m_GodWeaponDict = new Dictionary<int, Dictionary<int, GodWeaponConfig>>();
        static Dictionary<int, List<GodWeaponConfig>> m_GodWeaponList = new Dictionary<int, List<GodWeaponConfig>>();
 
        public void OnConfigParseCompleted()
        {
            Dictionary<int, GodWeaponConfig> dict;
            if (!m_GodWeaponDict.TryGetValue(Type, out dict))
            {
                dict = new Dictionary<int, GodWeaponConfig>();
                m_GodWeaponDict.Add(Type, dict);
            }
            if (!dict.ContainsKey(Lv))
            {
                dict.Add(Lv, this);
            }
 
            List<GodWeaponConfig> list = null;
            if (!m_GodWeaponList.TryGetValue(Type, out list))
            {
                list = new List<GodWeaponConfig>();
                m_GodWeaponList.Add(Type, list);
            }
            list.Add(this);
        }
 
        public static GodWeaponConfig GetConfig(int type, int level)
        {
            Dictionary<int, GodWeaponConfig> dict;
            if (m_GodWeaponDict.TryGetValue(type, out dict))
            {
                if (dict.ContainsKey(level))
                {
                    return dict[level];
                }
            }
            return null;
        }
 
        public static List<GodWeaponConfig> GetConfigs(int type)
        {
            List<GodWeaponConfig> list = null;
            m_GodWeaponList.TryGetValue(type, out list);
            return list;
        }
 
        public static List<int> GetGodWeaponType()
        {
            return m_GodWeaponList.Keys.ToList();
        }
    }
}