Example #1
0
        FlightSchedule FindFlightSchedule(string destination, int gateNum, DateTime arrival, DateTime departure)
        {
            FlightSchedule scheduleToCheck = new FlightSchedule(destination, gateNum, arrival, departure);

            //is there any schedules equals the line
            bool dotheyMatch = SimulationManager.Flightplans.Any(fp => fp.Equals(scheduleToCheck));

            if (!dotheyMatch)
            {
                //if no then add it to FlightSchedule
                SimulationManager.Flightplans.Add(scheduleToCheck);
            }
            return(SimulationManager.Flightplans.Where(fp => fp.Equals(scheduleToCheck)).First());
        }
Example #2
0
 public FlightEventArgs(FlightSchedule schedule)
 {
     this.Schedule = schedule;
 }
Example #3
0
 //This constructer is used when flight take off
 public FlightEventArgs(FlightSchedule schedule, int passengers)
 {
     this.Schedule = schedule;
     this.Schedule.PassengerAmount = passengers;
 }