static void Main(string[] args) { ContinentFactory asia = new AsiaFactory(); AnimalWorld world = new AnimalWorld(asia); world.RunFoodChain(); ContinentFactory america = new AmericaFactory(); world = new AnimalWorld(america); world.RunFoodChain(); }
static void Main(string[] args) { ContinentFactory myContinentFactory = new AfricaFactory(); AnimalWorld myAnimalWorld = new AnimalWorld(myContinentFactory); myAnimalWorld.RunFoodChain(); myContinentFactory = new AmericaFactory(); myAnimalWorld = new AnimalWorld(myContinentFactory); myAnimalWorld.RunFoodChain(); }
static void Main(string[] args) { ContinentFactory africa = new AfricaFactory(); AnimalWorld world = new AnimalWorld(africa); world.RunFoodChain(); ContinentFactory america = new AmericaFactory(); world = new AnimalWorld(america); world.RunFoodChain(); Console.ReadKey(); }
static void Main(string[] args) { ContinentFactory africa = new AfricaFactory(); AnimalWorld world = new AnimalWorld(africa); world.RunFoodChain(); ContinentFactory america = new AmericaFactory(); world = new AnimalWorld(america); world.RunFoodChain(); Console.ReadKey(); }
public void Main() { // Create and run the African animal world IContinentFactory africa = new AfricaFactory(); var world = new AnimalWorld(africa); world.RunFoodChain(); // Create and run the American animal world IContinentFactory america = new AmericaFactory(); world = new AnimalWorld(america); world.RunFoodChain(); }
/// <summary> /// Entry point into console application. /// </summary> public static void Main() { // Create and run the African animal world ContinentFactory africa = new AfricaFactory(); AnimalWorld world = new AnimalWorld(africa); world.RunFoodChain(); // Create and run the American animal world ContinentFactory america = new AmericaFactory(); world = new AnimalWorld(america); world.RunFoodChain(); // Wait for user input Console.ReadKey(); }
static void Main(string[] args) { // Create and run the African animal world ContinentFactory africa = new AfricaFactory(); AnimalWorld world = new AnimalWorld(africa); world.RunFoodChain(); // Create and run the American animal world ContinentFactory america = new AmericaFactory(); world = new AnimalWorld(america); world.RunFoodChain(); Console.ReadKey(); }
static void Main(string[] args) { Console.WriteLine("Animales concretos de africa"); IContinentFactory africa = new AfricaFactory(); AnimalWorld clienteAfrica = new AnimalWorld(africa); clienteAfrica.RunFoodChain(); Console.WriteLine("Animales concretos de america"); IContinentFactory america = new AmericaFactory(); AnimalWorld clienteAmerica = new AnimalWorld(america); clienteAmerica.RunFoodChain(); Console.ReadKey(); }
public static void Run() { Console.WriteLine("This real-world code demonstrates the creation of different animal worlds for a computer game using different factories. Although the animals created by the Continent factories are different, the interactions among the animals remain the same."); ContinentFactory africa = new AfricaFactory(); AnimalWorld world = new AnimalWorld(africa); world.RunFoodChain(); ContinentFactory america = new AmericaFactory(); world = new AnimalWorld(america); world.RunFoodChain(); /* * Lion eats Wildebeest * Wolf eats Bison */ }
/// <summary> /// Entry point into console application. /// </summary> public static void Main() { // Create and run the African animal world ContinentFactory africa = new AfricaFactory(); AnimalWorld world = new AnimalWorld(africa); world.RunFoodChain(); // Create and run the American animal world ContinentFactory america = new AmericaFactory(); world = new AnimalWorld(america); world.RunFoodChain(); // Wait for user input Console.ReadKey(); }