/// <summary> /// Recursive method to generate treenodes for tvSkillList /// </summary> /// <param name="requiredSkill">An EntityRequiredSkill object</param> /// <returns></returns> private TreeNode GetSkillNode(StaticSkillLevel prereq, ref bool allSkillsKnown, ref bool skillsUnplanned) { var character = (Character)m_plan.Character; Skill skill = character.Skills[prereq.Skill]; TreeNode node = new TreeNode(prereq.ToString()); node.Tag = new SkillLevel(skill, prereq.Level); // Skill requirement met if (skill.Level >= prereq.Level) { node.ImageIndex = 1; node.SelectedImageIndex = 1; } // Requirement not met, but planned else if (m_plan.IsPlanned(skill, prereq.Level)) { node.ImageIndex = 2; node.SelectedImageIndex = 2; allSkillsKnown = false; } // Requirement not met, but trainable else if (skill.Level < prereq.Level && skill.IsKnown) { node.ImageIndex = 3; node.SelectedImageIndex = 3; allSkillsKnown = false; skillsUnplanned = true; } // Requirement not met else { node.ImageIndex = 0; node.SelectedImageIndex = 0; allSkillsKnown = false; skillsUnplanned = true; } // Generate child nodes if required foreach (StaticSkillLevel childPrereq in skill.StaticData.Prerequisites) { node.Nodes.Add(GetSkillNode(childPrereq, ref allSkillsKnown, ref skillsUnplanned)); } return(node); }
/// <summary> /// Recursive method to generate treenodes for tvCertList. /// </summary> /// <param name="requiredSkill">An EntityRequiredSkill object</param> /// <returns></returns> private TreeNode GetSkillNode(StaticSkillLevel prereq) { var character = (Character)m_plan.Character; Skill skill = character.Skills[prereq.Skill]; TreeNode node = new TreeNode(prereq.ToString()); node.Tag = new SkillLevel(skill, prereq.Level); // Generate child prerequisite skill nodes if required foreach (StaticSkillLevel childPrereq in skill.StaticData.Prerequisites) { node.Nodes.Add(GetSkillNode(childPrereq)); } return(node); }