Exemple #1
0
        private AbstractPizza AddIngredients(string add, AbstractPizza pizza)
        {

            switch (add)
            {
                case "Ham":
                    return new HamDecorator(pizza);
                case "Bacon":
                    return new BaconDecorator(pizza);
                case "Pepperoni":
                    return new PepperoniDecorator(pizza);
                default:
                    return pizza;
            }
        }
 public PizzaToMenuAdapter(AbstractPizza pizza)
 {
     Pizza = pizza;
     MenuPrice = pizza.Price;
     Drink = null;
 }
 public PizzaToMenuAdapter(string drink, double drinkPrice, AbstractPizza pizza)
 {
     Drink = drink;
     MenuPrice = drinkPrice + pizza.Price;
     Pizza = pizza;
 }