Exemplo n.º 1
0
        static void Main(string[] args)
        {
            ContinentFactory[] continentFactories = new ContinentFactory[]
            {
                new AfricaFactory(),
                new AmericaFactory()
            };

            Console.WriteLine(string.Join <ContinentFactory>($"{Environment.NewLine}{Environment.NewLine}", continentFactories));
        }
Exemplo n.º 2
0
 public AnimalWorld(ContinentFactory factory)
 {
     this.herbivore = factory.CreateHerbivore();
     this.carnivore = factory.CreateCarnivore();
 }
Exemplo n.º 3
0
 public Ecosystem(ContinentFactory factory)
 {
     _herbivore = factory.CreateHerbivore();
     _carnivore = factory.CreateCarnivore();
 }