Esempio n. 1
0
        private (bool success, ResolvedStop to) ComesFrom(Station origin, Time arrivalTime)
        {
            foreach (var departure in  Service.Details.Departures)
            {
                // If arrival at Stop before departure got to found stop so know that it does not come from location
                if (arrivalTime.IsBefore(departure.Time))
                {
                    return(false, null);
                }

                if (origin.Equals(departure.Station))
                {
                    return(true, ResolveStop(departure));
                }
            }

            return(false, null);
        }
Esempio n. 2
0
        private (bool success, ResolvedStop to) GoesTo(Station destination, Time departureTime)
        {
            foreach (var arrival in  Service.Details.Arrivals.Reverse())
            {
                // If arrival before Stop departure got to found stop so know that it does not go to location
                if (arrival.Time.IsBefore(departureTime))
                {
                    return(false, null);
                }

                if (destination.Equals(arrival.Station))
                {
                    return(true, ResolveStop(arrival));
                }
            }

            return(false, null);
        }
Esempio n. 3
0
 protected internal bool IsStopAt(Station at)
 {
     return(Station.Equals(at));
 }