Esempio n. 1
0
 public abstract void Eat(Herbivore h);
Esempio n. 2
0
 public override void Eat(Herbivore h)
 {
     // Eat Bison
       Console.WriteLine(this.GetType().Name +
     " eats " + h.GetType().Name);
 }
Esempio n. 3
0
 // Constructor
 public AnimalWorld(ContinentFactory factory)
 {
     _carnivore = factory.CreateCarnivore();
       _herbivore = factory.CreateHerbivore();
 }
Esempio n. 4
0
 public override void Eat(Herbivore a)
 {
     // Eat elephant
     Console.WriteLine(this.GetType().Name +
         " eats " + a.GetType().Name);
 }