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; }
/// <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; }