示例#1
0
        public void AddNode(Node node)
        {
            // add the node to the base list
            Nodes.Add(node);

            // add the node to the parent's childs list
            node.Parent.Childs.Add(node);

            AddBuffer.Enqueue(node);
        }
示例#2
0
        public void AddNode(Node node)
        {
            // add the node to the base list
            Nodes.Add(node);

            // if the current node does not have child, it is the last node in the path
            if (node.Child == null)
            {
                Last = node;
            }

            AddBuffer.Enqueue(node);
        }
示例#3
0
        public Tree(Node root, int maxSize, TreeBehaviour mode = TreeBehaviour.Cyclic)
        {
            MaxSize = maxSize;

            Nodes.Add(root);

            Root = root;

            AddBuffer.Enqueue(root);

            Model = new TreeModel(this);

            Mode = mode;
        }