Esempio n. 1
0
        public static void Execute()
        {
            // Cria e executa o mundo animal Africano
            var africa = new AfricaFactory();
            var mundo  = new MundoAnimal(africa);

            mundo.AdministrarCadeiaAlimentar();

            // Cria e executa o mundo animal Americano
            var america = new AmericaFactory();

            mundo = new MundoAnimal(america);
            mundo.AdministrarCadeiaAlimentar();
        }
        /// <summary>

        /// Entry point into console application.

        /// </summary>

        public static void Main()
        {
            // Create and run the African animal world

            ContinenteFabrica africa = new AfricaFabrica();
            MundoAnimal       mundo  = new MundoAnimal(africa);

            mundo.CadeiaAlimentar();

            // Create and run the American animal world

            ContinenteFabrica america = new AmericaFabrica();

            mundo = new MundoAnimal(america);
            mundo.CadeiaAlimentar();

            // Wait for user input

            Console.ReadKey();
        }
Esempio n. 3
0
 private void button8_Click(object sender, EventArgs e)
 {
     FactoriaContinente fc = new FactoriaAmerica();
     MundoAnimal a = new MundoAnimal(fc);
     a.CadenaAlimenticia();
 }