Example #1
0
 public void AddDuck(IDuck duck)
 {
     _ducks.Add(duck);
 }
 public void CookDuck(IDuck duck)
 {
     Console.WriteLine("Im cooking this duck: " + duck.Flavor());
 }
 public DuckAdapter(IDuck duck)
 {
     this.duck = duck;
 }
 private static void DuckClient(IDuck duck)
 {
     Console.WriteLine(duck.Quack());
     Console.WriteLine(duck.Fly());
 }
Example #5
0
 static void TestDuck(IDuck duck)
 {
     duck.Quack();
     duck.Fly();
 }
 public void MakeDuckSwim(IDuck duck)
 {
     duck.Swim();
 }
Example #7
0
 public void Detach(IDuck duck)
 {
     DucksInFlock.Remove(duck);
 }
Example #8
0
 public void Attach(IDuck duck)
 {
     DucksInFlock.Add(duck);
 }
 public static void GetInfo(IDuck duck)
 {
     duck.Quack();
     duck.Name();
     duck.Fly();
 }
Example #10
0
 public DuckAdapter(IDuck duck)
 {
     _duck = duck;
 }