public void RegistrerAircraft(Aircraft aircraft)
 {
     if (!_registeredAircrafts.Contains(aircraft))
     {
         _registeredAircrafts.Add(aircraft);
     }
 }
 public void SendWarningMessage(Aircraft aircraft)
 {
     var list = from a in _registeredAircrafts
                where a != aircraft &&
                      Math.Abs(a.Altitude - aircraft.Altitude) < 1000
                select a;
     foreach (var a in list)
     {
         a.ReceiveWarning(aircraft);
         aircraft.Climb(1000);
     }
 }
Esempio n. 3
0
 public void ReceiveWarning(Aircraft reportingAircraft)
 {
     Console.WriteLine("ATC: ({0}) - {1} is at your flight altitude!!!",this.RegistrationNumber,reportingAircraft.RegistrationNumber);
 }
Esempio n. 4
0
 public void ReceiveWarning(Aircraft reportingAircraft)
 {
     Console.WriteLine("ATC: ({0}) - {1} is at your flight altitude!!!", this.RegistrationNumber, reportingAircraft.RegistrationNumber);
 }