using System.Collections.Generic;
|
using System.Text;
|
|
public partial class ItemConfig : IConfigPostProcess
|
{
|
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;
|
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;
|
}
|
|
public static bool IsWing(int itemId)
|
{
|
var config = ItemConfig.Get(itemId);
|
return config != null && (config.Type == 111 || config.Type == 39 || config.Type == 52);
|
}
|
|
}
|
|
|