少年修仙传客户端代码仓库
client_Wu Xijin
2019-02-19 d4f4374daef80c14795317cd31a0380e3c30c318
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
using System.Collections.Generic;
using System.Text;
 
public partial class ItemConfig : IConfigPostProcess
{
    public static Dictionary<int, ItemConfig> tag_Wings = new Dictionary<int, ItemConfig>();//用来存储所有翅膀所需的Tpye
    private static Dictionary<int, ItemConfig> m_GemCfgs = new Dictionary<int, ItemConfig>();
    private const int GEM_TYPE_VALUE = 225;
 
    public void OnConfigParseCompleted()
    {
        switch (Type)
        {
            case 25:
            case 140:
                if (Effect1 == GEM_TYPE_VALUE)
                {
                    m_GemCfgs.Add(EffectValueB1 * 1000 + EffectValueA1, this);
                }
                break;
            case 111:
            case 39:
            case 52:
                tag_Wings.Add(ID, this);
                break;
            default:
                break;
        }
    }
 
    /// <summary>
    /// 根据宝石等级以及类型取到宝石数据
    /// </summary>
    /// <param name="level"></param>
    /// <param name="type"></param>
    /// <returns></returns>
    public static ItemConfig GetGemDataByLevelAndType(int level, int type)
    {
        ItemConfig item = null;
        m_GemCfgs.TryGetValue(level * 1000 + type, out item);
        return item;
    }
}