Пример #1
0
        // Adds a bus stop before a target bus stop
        // Adds a route with (newBusStop, 0) into RouteList, and before targetBusStop
        // and modify current travel time of newBusStop to traveltime
        // Exceptions - if inserted before the first stop (update later)
        public void InsertRouteBefore(string targetBusStop, string newBusStop, int travelTime)
        {
            Route newRoute = new Route(newBusStop, 0);
            int targetBusStopIndex = FindIndexOfBusStopWithName(targetBusStop);

            _routeList.Insert(targetBusStopIndex, newRoute);
            _routeList.ElementAt(targetBusStopIndex).UpdateTravelTime(travelTime);
        }
Пример #2
0
        /****************************************************************************************************/
        // METHODS - MODIFIERS (ROUTE)
        /****************************************************************************************************/

        // Adds a bus stop to the end of the route
        public void AddRoute(string initialStop, int travelTime)
        {
            Route newRoute = new Route(initialStop, travelTime);
            _routeList.Add(newRoute);
        }