Esempio n. 1
0
    protected override Pizza Make()
    {
        Portuguesa pizza = new Portuguesa();

        pizza.GetHam();
        pizza.GetPea();
        pizza.GetOnion();
        pizza.GetEgg();
        return((Pizza)pizza);
    }
Esempio n. 2
0
    protected override Pizza CreatePizza(string sabor)
    {
        Pizza pizza;
        IPizzaIngredientFactory ingredientFactory = new PremiumPizzaIngredientFactory();

        switch (sabor)
        {
        case "Portuguesa":
            pizza      = new Portuguesa(ingredientFactory);
            pizza.Nome = "Pizza Premium Portuguesa";
            break;

        case "Calabreza":
            pizza      = new Calabreza(ingredientFactory);
            pizza.Nome = "Pizza Premium Calabreza";
            break;
        }
        return(pizza);
    }