コード例 #1
0
ファイル: Program.cs プロジェクト: linuxchata/patterns
        public static void Main(string[] args)
        {
            var atc       = new YyyControl();
            var aircraft  = new Airbus321("RN1", atc);
            var aircraft2 = new Embraer190("RN2", atc);
            var aircraft3 = new Boeing737("RN3", atc);

            Console.WriteLine();

            aircraft.Altitude  += 100;
            aircraft2.Altitude += 200;

            Console.ReadKey();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            var flight1 = new Airbus321("AC159");
            var flight2 = new Boeing737200("WS203");

            flight2.Acknowledges(flight1);
            flight1.Acknowledges(flight2);

            var flight3 = new Embraer190("AC602");

            flight3.Acknowledges(flight1);
            flight1.Acknowledges(flight3);
            flight3.Acknowledges(flight2);
            flight2.Acknowledges(flight3);
        }