少年修仙传客户端代码仓库
client_Hale
2019-04-11 9f89e3be35da42eb9ccb44e6589d62f320aa444c
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
using System.Collections.Generic;
using System.Text;
 
public partial class TreasureRefineConfig : IConfigPostProcess
{
    private static Dictionary<string, TreasureRefineConfig> s_treasureRefineModelDict = new Dictionary<string, TreasureRefineConfig>();// key 当前表数据唯一ID
    private static Dictionary<int, List<TreasureRefineConfig>> s_treasureIDRefineModelDict = new Dictionary<int, List<TreasureRefineConfig>>();// key 法宝ID
    private static StringBuilder refineIDStr = new StringBuilder();
 
    public void OnConfigParseCompleted()
    {
        try
        {
            s_treasureRefineModelDict.Add(StringUtility.Contact(TreasureID, TreasureLV).ToString(), this);
        }
        catch (System.Exception ex)
        {
            DebugEx.Log(ex.ToString() + refineIDStr.ToString());
        }
 
        if (!s_treasureIDRefineModelDict.ContainsKey(TreasureID))
        {
            List<TreasureRefineConfig> modellist = new List<TreasureRefineConfig>();
            modellist.Add(this);
            s_treasureIDRefineModelDict.Add(TreasureID, modellist);
        }
        else
        {
            s_treasureIDRefineModelDict[TreasureID].Add(this);
        }
    }
 
    public static TreasureRefineConfig GetTreasureRefineModel(int treasureId, int lv)
    {
        string id = StringUtility.Contact(treasureId, lv).ToString();
        TreasureRefineConfig refineModel = null;
        s_treasureRefineModelDict.TryGetValue(id, out refineModel);
        return refineModel;
    }
 
    public static List<TreasureRefineConfig> GetTreasureRefineList(int treasureId)
    {
        List<TreasureRefineConfig> modellist = null;
        s_treasureIDRefineModelDict.TryGetValue(treasureId, out modellist);
        return modellist;
    }
 
    public static Dictionary<int, List<TreasureRefineConfig>> GetTreasureRefineDict()
    {
        return s_treasureIDRefineModelDict;
    }
}