Esempio n. 1
0
        private List <SkillNode> findChildren(SkillNode parent)
        {
            var children   = parents[parent.getSkill().name];
            var childNodes = new List <SkillNode>();

            if (children.Count > 0)
            {
                foreach (var child in children)
                {
                    var childNode         = new SkillNode(child, parent);
                    var foundNodeChildren = findChildren(childNode);
                    childNode.addChildren(foundNodeChildren);
                    childNodes.Add(childNode);
                }
            }

            return(childNodes);
        }
Esempio n. 2
0
 public void addChild(SkillNode skillNode)
 {
     children.Add(skillNode);
 }
Esempio n. 3
0
 public SkillNode(Skill value, SkillNode parent, List <SkillNode> children = null)
 {
     this.value    = value;
     this.parent   = parent;
     this.children = children != null? children : new List <SkillNode>();
 }