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); } } } } }
public void insertAdjacent(Adjacent adjacent) { adjacenceList.Add(adjacent); }