コード例 #1
0
ファイル: Program.cs プロジェクト: Iulian-Stan/DesignPatterns
 // 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
 public AnimalWorld(ContitentFactory factory)
 {
     _herbivore     = factory.CreateHerbivore();
     _carnivore     = factory.CreateCarnivore();
     _superPredator = factory.CreateSuperPredator();
 }
コード例 #4
0
 public void NutritionCarnivores(Carnivore carnivore, Herbivore herbivore)
 {
     carnivore.Eat(herbivore);
 }
コード例 #5
0
 public AnimalWorld(ContinentFactory p_factory)
 {
     m_carnivore = p_factory.CreateCarnivore();
     m_herbivore = p_factory.CreateHerbivore();
 }