// ------------------------------------------------------------------------------
//
// This code was generated by a tool.
// Mono Runtime Version: 2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
// ------------------------------------------------------------------------------
namespace TableConfig
{
using System;
using System.Collections.Generic;
public partial class PetInfoConfig : ConfigBase, IConfigPostProcess
{
public static Dictionary> petSkillDict = new Dictionary>();
public void OnConfigParseCompleted()
{
List list = null;
if (!petSkillDict.TryGetValue(ID, out list))
{
list = new List();
petSkillDict.Add(ID, list);
}
var skills = ConfigParse.GetMultipleStr(SkillID);
var skillUnlocks = ConfigParse.GetMultipleStr(SkillUnLock);
for (int i = 0; i < skills.Length; i++)
{
list.Add(new PetSkillLimit()
{
skill = skills[i],
lv = skillUnlocks[i],
});
}
}
public static void GetPetSkills(int petId, int lv, bool onlyAcitve, ref List skills)
{
if (skills == null)
{
return;
}
skills.Clear();
List list = null;
if (petSkillDict.TryGetValue(petId, out list))
{
for (int i = 0; i < list.Count; i++)
{
if (lv < list[i].lv && onlyAcitve)
{
continue;
}
skills.Add(list[i].skill);
}
}
}
public static int GetPetSkillCondition(int petId, int skillId)
{
List list = null;
if (petSkillDict.TryGetValue(petId, out list))
{
for (int i = 0; i < list.Count; i++)
{
if (skillId == list[i].skill)
{
return list[i].lv;
}
}
}
return 0;
}
public static bool TryGetPetIdBySkill(int skillId, out int petId)
{
petId = 0;
foreach (var key in petSkillDict.Keys)
{
var list = petSkillDict[key];
for (int i = 0; i < list.Count; i++)
{
if (list[i].skill == skillId)
{
petId = key;
return true;
}
}
}
return false;
}
public struct PetSkillLimit
{
public int skill;
public int lv;
}
}
}