Пример #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 Train 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>Train that was found/created</returns>
 public Train GetOrCreateTrain(String name)
 {
     Train result = null;
     foreach (Train t in trains)
     {
         if (t.GetName().Equals(name))
         {
             result = t;
         }
     }
     if (result == null)
     {
         result = new Train(name);
     }
     return result;
 }