Example #1
0
 private void addAdjacent(Flight flight)
 {
     foreach (Node node in nodeList)
     {
         if (node.getCity().getName() == flight.getOriginCity())
         {
             foreach (Node nodeAux in nodeList)
             {
                 if (nodeAux.getCity().getName() == flight.getDestinationCity())
                 {
                     Adjacent adjacent = new Adjacent(nodeAux, flight.getCost(), flight.getFlightTime());
                     node.insertAdjacent(adjacent);
                 }
             }
         }
     }
 }
Example #2
0
 public void insertAdjacent(Adjacent adjacent)
 {
     adjacenceList.Add(adjacent);
 }