예제 #1
0
 // Constructor
 public AnimalWorld(ContinentFactory factory)
 {
     carnivore = factory.CreateCarnivore();
     herbivore = factory.CreateHerbivore();
 }
예제 #2
0
 // Constructor
 public AnimalWorld(ContinentFactory factory)
 {
     _carnivore = factory.CreateCarnivore();
     _herbivore = factory.CreateHerbivore();
 }
예제 #3
0
파일: Program.cs 프로젝트: mtsi/codesamples
 public override void Eat(Carnivore c)
 {
     Console.WriteLine(this.GetType().Name +
         " eats " + c.GetType().Name);
 }
예제 #4
0
파일: Program.cs 프로젝트: mtsi/codesamples
 // Constructor
 public AnimalWorld(ContinentFactory factory)
 {
     _carnivore = factory.CreateCarnivore();
     _herbivore = factory.CreateHerbivore();
     _problem = factory.CreateProblem();
     _giant = factory.CreateGiant();
     _giant2 = factory.CreateSmallGiant();
 }
예제 #5
0
파일: Program.cs 프로젝트: mtsi/codesamples
 public abstract void Eat(Carnivore c);