コード例 #1
0
        static void Main(string[] args)
        {
            PizzaStore PS = new FactoryMexicana();

            PS.create("mexicana");
            Console.WriteLine("\n\n");
            PizzaStore ps = new FactoryFregona();

            ps.create("fregona");
            Console.ReadLine();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            PizzaStore PS         = new FactoryMexicana();
            Pizza      nuevaPizza = PS.create("mexicana");

            Console.WriteLine(nuevaPizza.GetType().Name);
            Console.WriteLine(nuevaPizza.empacar());
            Console.WriteLine(nuevaPizza.enviar());
            Console.WriteLine("\n\n");
            PizzaStore ps          = new FactoryFregona();
            Pizza      nuevaPizza2 = ps.create("fregona");

            Console.WriteLine(nuevaPizza2.GetType().Name);
            Console.WriteLine(nuevaPizza2.empacar());
            Console.WriteLine(nuevaPizza2.enviar());
            Console.ReadLine();
        }