示例#1
0
        static void Main(string[] args)
        {
            Pizzeria pizzeria;
            Pizza    pizza;

            pizzeria = new PizzeriaArgentina();

            pizza = pizzeria.CrearPizza("napo");
            pizza.Render();
            pizza = pizzeria.CrearPizza("cancha");
            pizza.Render();

            pizzeria = new PizzeriaItaliana();
            pizza    = pizzeria.CrearPizza("napo");
            pizza.Render();
            pizza = pizzeria.CrearPizza("cancha");
            pizza.Render();
            Console.ReadKey();
        }
示例#2
0
        static void Main(string[] args)
        {
            Pizzeria fabrica;

            fabrica = new PizzeriaArgentina();

            Pizza    pizza    = fabrica.CrearPizza();
            Empanada empanada = fabrica.CrearEmpanada();

            Console.WriteLine($"Pizza: {pizza.Descripcion}, Empanada: {empanada.Descripcion}");

            fabrica  = new PizzeriaItaliana();
            pizza    = fabrica.CrearPizza();
            empanada = fabrica.CrearEmpanada();
            Console.WriteLine($"Pizza: {pizza.Descripcion}, Empanada: {empanada.Descripcion}");

            fabrica  = new PizzeriaChina();
            pizza    = fabrica.CrearPizza();
            empanada = fabrica.CrearEmpanada();
            Console.WriteLine($"Pizza: {pizza.Descripcion}, Empanada: {empanada.Descripcion}");

            Console.ReadKey();
        }