public void Visit(IBanana banana)
 {
     banana.Peel();
     banana.Eat();
 }
Exemple #2
0
 /// <summary>
 /// Constructor of <see cref="Mixer"/>
 /// </summary>
 /// <param name="apple">Implementation of IApple instance</param>
 /// <param name="banana">Implementation of IBanana instance</param>
 public Mixer(IApple apple, IBanana banana)
 {
     _apple = apple;
     _banana = banana;
 }
Exemple #3
0
 public static IFruit AsFruit(this IBanana banana)
 {
     return(new FruitAdaptor(banana.GetName()));
 }