static void Main(string[] args)
        {
            RedMallard a = new RedMallard(); simulate(a);
            Turkey t=new Turkey();
            Duck tb = new TurkeyAdapter(t);
            simulate(tb);

            string z = Console.ReadLine();
        }
示例#2
0
 static void Main(string[] args)
 {
     MallardDuck myduck = new MallardDuck();
     WildTurkey myturkey = new WildTurkey();
     Duck turkeyadapter = new TurkeyAdapter(myturkey);
     myturkey.Gobble();            myturkey.Fly();
     myduck.Quack();            myduck.Fly();
     turkeyadapter.Quack();            turkeyadapter.Fly();
     string z = Console.ReadLine();
 }