Ejemplo n.º 1
0
 public Connection(Entity parent, TypeOfConnection type, Entity child)
 {
     Parent = parent;
     Child  = child;
     Type   = type;
     parent.Connections.Add(this);
 }
Ejemplo 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("нет");
 }