Beispiel #1
0
        static void Main(string[] args)
        {
            /*both sides*/
            ITurkey turkey = new TurkeyDuckAdapter();

            turkey.Fly();
            turkey.Gobble();

            /*Turkey to duck*/

            Turkey turkeyy = new Turkey();

            IDuck turkeyAdapter = new TurkeyAdapter(turkeyy);

            Console.WriteLine("----------------------------------");
            turkeyAdapter.Fly();
            turkeyAdapter.Quack();
            Console.ReadKey();
        }
Beispiel #2
0
 public TurkeyAdapter(Turkey turkey)
 {
     this.turkey = turkey;
 }