Пример #1
0
 /// <summary>
 /// Adds a transition from this node to the <paramref name="target"/>
 /// </summary>
 /// <param name="target">The node to connect to</param>
 public void AddTransition(Node target)
 {
     if (!hasTransition(target)) {
         var transition = new Transition(this, target);
         target.Transitions.Add(this, transition);
         Transitions.Add(target, transition);
     }
 }
Пример #2
0
 /// <summary>
 /// Removes a single transition (<paramref name="transition"/> to and from this node
 /// </summary>
 /// <param name="transition">The transition to remove</param>
 private void removeTransition(Transition transition)
 {
     Node otherNode;
     if (transition.Nodes[0] == this) {
         otherNode = transition.Nodes[1];
     } else {
         otherNode = transition.Nodes[0];
     }
     otherNode.Transitions.Remove(this);
     this.Transitions.Remove(otherNode);
 }