コード例 #1
0
 public void RegistrerAircraft(Aircraft aircraft)
 {
     if (!_registeredAircrafts.Contains(aircraft))
     {
         _registeredAircrafts.Add(aircraft);
     }
 }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
ファイル: Aircraft.cs プロジェクト: votrongdao/DesignPatterns
 public void ReceiveWarning(Aircraft reportingAircraft)
 {
     Console.WriteLine("ATC: ({0}) - {1} is at your flight altitude!!!",this.RegistrationNumber,reportingAircraft.RegistrationNumber);
 }
コード例 #4
0
 public void ReceiveWarning(Aircraft reportingAircraft)
 {
     Console.WriteLine("ATC: ({0}) - {1} is at your flight altitude!!!", this.RegistrationNumber, reportingAircraft.RegistrationNumber);
 }