Exemple #1
0
        public RedPointNode GetNode(RedPointType type)
        {
            RedPointNode node = null;

            if (root != null)
            {
                node = FindNode(root, type);
            }
            return(node);
        }
Exemple #2
0
        private RedPointNode FindNode(RedPointNode source, RedPointType type)
        {
            RedPointNode node = null;

            for (int i = 0; i < source.childs.Count; i++)
            {
                node = source.childs[i];
                if (node.type != type)
                {
                    node = FindNode(node, type);
                    if (node != null)
                    {
                        break;
                    }
                }
                else
                {
                    break;
                }
            }
            return(node);
        }
Exemple #3
0
 public void AddChild(RedPointNode node)
 {
     this.isLeaf = false;
     node.parent = this;
     childs.Add(node);
 }
Exemple #4
0
 public void SetRoot(RedPointNode root)
 {
     this.root        = root;
     this.root.isRoot = true;
     this.root.isLeaf = true;
 }