Esempio n. 1
0
 public Connection(Entity parent, TypeOfConnection type, Entity child)
 {
     Parent = parent;
     Child  = child;
     Type   = type;
     parent.Connections.Add(this);
 }
Esempio n. 2
0
 public string GetAnswer(Entity parent, TypeOfConnection type_of_c, Entity child)
 {
     foreach (Connection connection in parent.Connections)
     {
         if (connection.Type == type_of_c)
         {
             if (connection.Child == child)
             {
                 return("да");
             }
             else
             if (GetAnswer(connection.Child, type_of_c, child) == "да")
             {
                 return("да");
             }
         }
     }
     return("нет");
 }