using System.Collections.Generic;
|
using System.Text;
|
namespace TableConfig
|
{
|
public partial class SkillConfig : ConfigBase, IConfigPostProcess
|
{
|
/// <summary>
|
/// 根据职业以及技能类型存储技能
|
/// </summary>
|
private static Dictionary<int, Dictionary<int, Dictionary<int, List<SkillConfig>>>> m_Skills = new Dictionary<int, Dictionary<int, Dictionary<int, List<SkillConfig>>>>();
|
|
public void OnConfigParseCompleted()
|
{
|
#region 根据职业以及技能类型以及技能等级
|
Dictionary<int, Dictionary<int, List<SkillConfig>>> funcDic = null;
|
Dictionary<int, List<SkillConfig>> typeDic = null;
|
List<SkillConfig> lvlist = null;
|
m_Skills.TryGetValue(UseType, out funcDic);
|
if (funcDic != null)
|
{
|
funcDic.TryGetValue(FuncType, out typeDic);
|
if (typeDic != null)
|
{
|
typeDic.TryGetValue(SkillTypeID, out lvlist);
|
if (lvlist != null)
|
{
|
lvlist.Add(this);
|
}
|
else
|
{
|
lvlist = new List<SkillConfig>();
|
lvlist.Add(this);
|
typeDic.Add(SkillTypeID, lvlist);
|
}
|
}
|
else
|
{
|
typeDic = new Dictionary<int, List<SkillConfig>>();
|
lvlist = new List<SkillConfig>();
|
lvlist.Add(this);
|
typeDic.Add(SkillTypeID, lvlist);
|
funcDic.Add(FuncType, typeDic);
|
}
|
}
|
else
|
{
|
funcDic = new Dictionary<int, Dictionary<int, List<SkillConfig>>>();
|
typeDic = new Dictionary<int, List<SkillConfig>>();
|
lvlist = new List<SkillConfig>();
|
lvlist.Add(this);
|
typeDic.Add(SkillTypeID, lvlist);
|
funcDic.Add(FuncType, typeDic);
|
m_Skills.Add(UseType, funcDic);
|
}
|
#endregion
|
#region 坐骑技能获取
|
_textBuilder.Length = 0;
|
if (FuncType == 5)
|
{
|
_textBuilder.Append(SkillTypeID);
|
_textBuilder.Append(SkillLV);
|
T_HorseSkill.Add(_textBuilder.ToString(), this);
|
}
|
|
#endregion
|
}
|
|
//--坐骑技能获取
|
private static StringBuilder _textBuilder = new StringBuilder();
|
public static Dictionary<string, SkillConfig> T_HorseSkill = new Dictionary<string, SkillConfig>();
|
|
/// <summary>
|
/// 根据职业类型以及技能类型获取技能
|
/// </summary>
|
/// <param name="occupy"></param>
|
/// <param name="type"></param>
|
/// <returns></returns>
|
public static Dictionary<int, List<SkillConfig>> GetSkillWithOccpyAndType(int occupy, int type)
|
{
|
Dictionary<int, Dictionary<int, List<SkillConfig>>> dic = null;
|
Dictionary<int, List<SkillConfig>> typeDic = null;
|
m_Skills.TryGetValue(occupy, out dic);
|
if (dic != null)
|
{
|
dic.TryGetValue(type, out typeDic);
|
}
|
return typeDic;
|
}
|
|
public static List<SkillConfig> GetSkillActConfigs(int occupy, int type, int _typeId)
|
{
|
List<SkillConfig> _list = null;
|
Dictionary<int, List<SkillConfig>> _dict = GetSkillWithOccpyAndType(occupy, type);
|
if (_dict != null)
|
{
|
_dict.TryGetValue(_typeId, out _list);
|
}
|
return _list;
|
}
|
|
public static Dictionary<int, Dictionary<int, List<SkillConfig>>> GetSkillActive(int occupy)
|
{
|
Dictionary<int, Dictionary<int, List<SkillConfig>>> dic = null;
|
m_Skills.TryGetValue(occupy, out dic);
|
return dic;
|
}
|
//------坐骑技能获取
|
public static SkillConfig GetSkillTypeIDAndSkillLV(int _SkillTypeID, int SkillLV)
|
{
|
_textBuilder.Length = 0;
|
_textBuilder.Append(_SkillTypeID.ToString() + SkillLV.ToString());
|
SkillConfig _tagChinSkillModel = null;
|
T_HorseSkill.TryGetValue(_textBuilder.ToString(), out _tagChinSkillModel);
|
return _tagChinSkillModel;
|
|
}
|
|
}
|
}
|
|