Ejemplo n.º 1
0
 public CombinedNode(CombinedNode newNode)
 {
     this.name        = newNode.name;
     this.probability = newNode.probability;
     this.type        = newNode.type;
     this.val         = newNode.val;
     this.Children    = newNode.Children;
     this.IsInverse   = newNode.IsInverse;
 }
Ejemplo n.º 2
0
 public int GetPosition(int pos, CombinedNode node)
 {
     if (this == node)
     {
         return(pos);
     }
     foreach (CombinedNode item in Children)
     {
         int returnano = item.GetPosition(1 + pos, node);
         if (returnano > pos)
         {
             return(returnano);
         }
     }
     return(pos - 1);
 }
Ejemplo n.º 3
0
 public bool Delete(CombinedNode node)
 {
     foreach (var child in Children)
     {
         if (child == node)
         {
             Children.Remove(child);
             return(true);
         }
         else
         {
             bool response = child.Delete(node);
             if (response)
             {
                 return(true);
             }
         }
     }
     return(false);
 }