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;
|
}
|
}
|