예제 #1
0
            public override Node AddChild(TKey child, TWeight weight = default)
            {
                if (children.ContainsKey(child))
                {
                    return(nodes[child]);
                }
                DAGraphNode node = null;

                if (nodes.ContainsKey(child))
                {
                    node = (DAGraphNode)nodes[child];
                }
                else
                {
                    node = new DAGraphNode(Container, child, Level + 1);
                }
                ++node.tracking;
                children[child] = weight;
                return(node);
            }
예제 #2
0
 public override void Init(TKey key, TValue value = default)
 {
     Root = new DAGraphNode(this, key, value);
 }