少年修仙传客户端代码仓库
client_Wu Xijin
2019-02-14 66f58a34f8ff3fcf72ab53f774a09847a03fe3d7
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
60
61
62
63
64
65
66
67
68
69
70
71
72
using System.Collections.Generic;
using System.Text;
 
public partial class ItemConfig : IConfigPostProcess
{
    public static Dictionary<int, ItemConfig> tag_DicID = new Dictionary<int, ItemConfig>();//用于灵兽
    public static Dictionary<int, ItemConfig> tag_ZJSH = new Dictionary<int, ItemConfig>();//用于坐骑兽魂
    public static Dictionary<int, ItemConfig> tag_Type27 = new Dictionary<int, ItemConfig>();//灵兽口粮
    public static Dictionary<int, ItemConfig> tag_DicIDCM = new Dictionary<int, ItemConfig>();
    public static Dictionary<int, ItemConfig> tag_Wings = new Dictionary<int, ItemConfig>();//用来存储所有翅膀所需的Tpye
    #region 宝石数据
    private static StringBuilder _textBuilder = new StringBuilder();
    private static Dictionary<string, ItemConfig> m_GemCfgs = new Dictionary<string, ItemConfig>();
    private const int GEM_TYPE_VALUE = 225;
    private const int GEM_TYPE = 25;
    #endregion
 
    public void OnConfigParseCompleted()
    {
        #region 宝石数据
        _textBuilder.Length = 0;
        if ((Type == GEM_TYPE
            || Type == 140) && Effect1 == GEM_TYPE_VALUE)
        {
            _textBuilder.Append(EffectValueB1.ToString());
            _textBuilder.Append(EffectValueA1.ToString());
            m_GemCfgs.Add(_textBuilder.ToString(), this);
        }
        #endregion
 
        if (Type == 28)
        {
            tag_DicID.Add(ID, this);
        }
        else if (Type == 29)
        {
            tag_DicIDCM.Add(ID, this);
 
        }
        else if (Type == 22)
        {
            tag_ZJSH.Add(ID, this);
        }
        else if (Type == 27)
        {
            tag_Type27.Add(ID, this);
        }
        else if (Type == 111 || Type == 39 || Type == 52)
        {
            tag_Wings.Add(ID, this);
        }
    }
 
    #region 宝石数据
    /// <summary>
    /// 根据宝石等级以及类型取到宝石数据
    /// </summary>
    /// <param name="level"></param>
    /// <param name="type"></param>
    /// <returns></returns>
    public static ItemConfig GetGemDataByLevelAndType(int level, int type)
    {
        _textBuilder.Length = 0;
        _textBuilder.Append(level.ToString() + type.ToString());
        ItemConfig item = null;
        m_GemCfgs.TryGetValue(_textBuilder.ToString(), out item);
        return item;
    }
    #endregion
}