Esempio n. 1
0
 static bool TryFind(Node n, ExpConstants id, out Node found)
 {
     if ((ExpConstants)n.Id == id)
     {
         found = n;
         return(true);
     }
     for (var i = 0; i < n.GetChildCount(); ++i)
     {
         if (TryFind(n[i], id, out found))
         {
             return(true);
         }
     }
     found = default;
     return(false);
 }
Esempio n. 2
0
 static Node Find(Node n, ExpConstants id)
 {
     Assert.IsTrue(TryFind(n, id, out var found));
     return(found);
 }