Example #1
0
 public string GetNameAt(StopGroup stop, DateTime time)
 {
     if (TripType.HeadsignEntries != null && TripType.HeadsignEntries.Any())
     {
         int    index    = IndexAt(stop, time);
         string lastName = TripType.Name;
         foreach (var entry in TripType.HeadsignEntries)
         {
             if (entry.StartIndex > index)
             {
                 break;
             }
             lastName = entry.Headsign;
         }
         return(lastName);
     }
     else
     {
         return(TripType.Name);
     }
 }
Example #2
0
 public int IndexAt(StopGroup stop, DateTime dateTime)
 {
     return(Stops.IndexOfMin(x => x.Item2.Group == stop ? dateTime.NextDateTimeAt(x.Item1) : DateTime.MaxValue));
 }
Example #3
0
 public double Distance(StopGroup other)
 {
     return(Stops.Join(other.Stops, s => 0, s => 0, (s1, s2) => s1.StraightLineDistanceTo(s2)).Min());
 }