Пример #1
0
        public static double GetSauceCost(Sauces sauce)
        {
            var standardSauceCost = 0.25;
            var specialSauceCost  = 0.5;

            return(sauce == Sauces.Barbecue ? specialSauceCost : standardSauceCost);
        }
Пример #2
0
        public SauceDecorator(Pizza pizza, Sauces sauce)
            : base(pizza)
        {
            Sauce = sauce;

            cost        = PricingClient.GetSauceCost(Sauce);
            description = $"{Sauce} sauce";
        }
Пример #3
0
 public IPizzaBuilderCrust WithSauce(Sauces sauce)
 {
     pizza = new SauceDecorator(pizza, sauce);
     return(this);
 }
Пример #4
0
 public IPizzaBuilderToppings WithSauce(Sauces selectedSauce)
 {
     pizza.Sauce = selectedSauce;
     return(this);
 }