hch
107 分钟以前 e7d6564ea36b0e3a2ebce2d4d0fc1d0056338254
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
using System.Collections.Generic;
using UnityEngine;
 
public partial class GoldRushItemConfig : ConfigBase<int, GoldRushItemConfig>
{
    //物品ID:等级:配置
    public static Dictionary<int, Dictionary<int, GoldRushItemConfig>> configDics = new Dictionary<int, Dictionary<int, GoldRushItemConfig>>();
 
    public static Dictionary<int, int> maxLVDic = new Dictionary<int, int>();
 
    protected override void OnConfigParseCompleted()
    {
        Dictionary<int, GoldRushItemConfig> tempDic = null;
        if (!configDics.TryGetValue(ItemID, out tempDic))
        {
            tempDic = new Dictionary<int, GoldRushItemConfig>();
            configDics.Add(ItemID, tempDic);
        }
 
        tempDic[ItemLV] = this;
 
        if (!maxLVDic.ContainsKey(ItemID))
        {
            maxLVDic.Add(ItemID, ItemLV);
        }
        else if (maxLVDic[ItemID] < ItemLV)
        {
            maxLVDic[ItemID] = ItemLV;
        }
    }
 
    public static GoldRushItemConfig GetConfig(int itemID, int itemLV)
    {
        if (configDics.ContainsKey(itemID))
        {
            if (configDics[itemID].ContainsKey(itemLV))
            {
                return configDics[itemID][itemLV];
            }
        }
        return null;
    }
 
    public static int GetMaxLV(int itemID)
    {
        if (maxLVDic.ContainsKey(itemID))
        {
            return maxLVDic[itemID];
        }
        return 0;
    }
}