static void Main(string[] args) { ContinentFactory[] continentFactories = new ContinentFactory[] { new AfricaFactory(), new AmericaFactory() }; Console.WriteLine(string.Join <ContinentFactory>($"{Environment.NewLine}{Environment.NewLine}", continentFactories)); }
public AnimalWorld(ContinentFactory factory) { this.herbivore = factory.CreateHerbivore(); this.carnivore = factory.CreateCarnivore(); }
public Ecosystem(ContinentFactory factory) { _herbivore = factory.CreateHerbivore(); _carnivore = factory.CreateCarnivore(); }