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); } }
public void ReceiveWarning(Aircraft reportingAircraft) { Console.WriteLine("ATC: ({0}) - {1} is at your flight altitude!!!",this.RegistrationNumber,reportingAircraft.RegistrationNumber); }
public void ReceiveWarning(Aircraft reportingAircraft) { Console.WriteLine("ATC: ({0}) - {1} is at your flight altitude!!!", this.RegistrationNumber, reportingAircraft.RegistrationNumber); }