// Constructor
 public AnimalWorld(ContinentFactory factory)
 {
     carnivore = factory.CreateCarnivore();
     herbivore = factory.CreateHerbivore();
 }
Exemple #2
0
 // Constructor
 public AnimalWorld(ContinentFactory factory)
 {
     _carnivore = factory.CreateCarnivore();
     _herbivore = factory.CreateHerbivore();
 }
Exemple #3
0
 public override void Eat(Carnivore c)
 {
     Console.WriteLine(this.GetType().Name +
         " eats " + c.GetType().Name);
 }
Exemple #4
0
 // Constructor
 public AnimalWorld(ContinentFactory factory)
 {
     _carnivore = factory.CreateCarnivore();
     _herbivore = factory.CreateHerbivore();
     _problem = factory.CreateProblem();
     _giant = factory.CreateGiant();
     _giant2 = factory.CreateSmallGiant();
 }
Exemple #5
0
 public abstract void Eat(Carnivore c);