예제 #1
0
 public ScheduleRecord(Schedule schedule, Station station, Train train, Direction dir, int time)
     : base()
 {
     this.schedule = schedule;
     this.station = station;
     this.train = train;
     this.dir = dir;
 }
예제 #2
0
 /// <summary>
 /// Finds a Station with the supplied name, if it can't find one it creates one with the supplied name
 /// </summary>
 /// <param name="name">Name to search for</param>
 /// <returns>Station that was found/created</returns>
 public Station GetOrCreateStation(String name)
 {
     Station result = null;
     foreach (Station t in stations)
     {
         if (t.GetName().Equals(name))
         {
             result = t;
         }
     }
     if (result == null)
     {
         result = new Station(name);
     }
     return result;
 }