コード例 #1
0
 // Constructor
 public AnimalWorld(ContinentFactory factory)
 {
     carnivore = factory.CreateCarnivore();
     herbivore = factory.CreateHerbivore();
 }
コード例 #2
0
ファイル: MainApp.cs プロジェクト: ronymaychan/demos
 // 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);