public static void AdapterExample() { Sparrow sparrow = new Sparrow(); IToyDuck toyDuck = new PlasticToyDuck(); IToyDuck birdAdapter = new BirdAdapter(sparrow); Console.WriteLine("Sparrow..."); sparrow.Fly(); sparrow.MakeSound(); Console.WriteLine("ToyDuck..."); toyDuck.Squeak(); Console.WriteLine("BirdAdapter"); birdAdapter.Squeak(); }
public BirdAdapter(Sparrow sparrow) { _sparrow = sparrow; }