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); }
public void addChild(SkillNode skillNode) { children.Add(skillNode); }
public SkillNode(Skill value, SkillNode parent, List <SkillNode> children = null) { this.value = value; this.parent = parent; this.children = children != null? children : new List <SkillNode>(); }