private bool ContainsSkill(PetActiveSkill skill) { foreach (var s in m_ActiveSkills) { if (s.id == skill.id) { return(true); } } return(false); }
public bool AddActiveSkill(PetActiveSkill skill) { if (m_ActiveSkills == null) { m_ActiveSkills = new List <PetActiveSkill>(); } if (ContainsSkill(skill)) { return(false); } m_ActiveSkills.Add(skill); return(true); }
private void ParseActiveSkills(List <Hashtable> listhash) { List <PetActiveSkill> skills = new List <PetActiveSkill>(); if (listhash != null) { foreach (Hashtable hash in listhash) { PetActiveSkill pas = new PetActiveSkill(); pas.ParseInfo(hash); skills.Add(pas); } } SetActiveSkills(skills); }