Пример #1
0
        public static void Main()
        {
            ContinentFactory africa = new AfricaFactory();
            AnimalWorld      world  = new AnimalWorld(africa);

            world.RunFoodChain();

            ContinentFactory america = new AmericaFactory();

            world = new AnimalWorld(america);
            world.RunFoodChain();

            // Wait for user input
            Console.ReadKey();
        }
Пример #2
0
        public static void Main()
        {
            ContinentFactory africa = new AfricaFactory();
              AnimalWorld world = new AnimalWorld(africa);
              world.RunFoodChain();

              ContinentFactory america = new AmericaFactory();
              world = new AnimalWorld(america);
              world.RunFoodChain();

              ContinentFactory asian = new AsianFactory();
              world = new AnimalWorld(asian);
              world.RunFoodChain();

              // Wait for user input
              Console.ReadKey();
        }