Exemplo n.º 1
0
        private bool AddPathSteps(string srcAirport, LinkedList <Route> path)
        {
            var routes = _swaggerWrapper.GetRoutes(srcAirport);

            if (srcAirport == _goal)
            {
                return(true);
            }

            foreach (var route in routes)
            {
                if (!_airlineService.AirlineIsActive(route.Airline))
                {
                    continue;
                }

                if (AddPathSteps(route.DestAirport, path))
                {
                    path.AddFirst(route);
                    return(true);
                }
            }
            return(false);
        }