Fhnw.Ecnf.RoutePlanner.RoutePlannerLib.Routes.FindPath C# (CSharp) Method

FindPath() protected method

protected FindPath ( List citiesOnRoute, TransportModes mode ) : List
citiesOnRoute List
mode TransportModes
return List
        protected List<Link> FindPath(List<City> citiesOnRoute, TransportModes mode)
        {
            City to = null;
            var itinerary = new List<Link>();
            foreach (City c in citiesOnRoute)
            {
                City from = to;
                to = c;
                if (from != null)
                {
                    Link l = FindLink(from, to, mode);
                    if (l != null)
                    {
                        itinerary.Add(l);
                    }
                }
            }
            return itinerary;
        }