public IPizzaPriceCalculator ChangePizzaPriceCalculator(IPizzaPriceCalculator calculator)
        {
            IPizzaPriceCalculator result = calculator;

            foreach (IPlugin plugin in plugins)
            {
                result = plugin.ChangePizzaPriceCalculator(result);
            }
            return(result);
        }
Beispiel #2
0
 public PriceStep(IPizzaPriceCalculator priceCalculator, IPizzaFactory pizzaFactory)
 {
     this.priceCalculator = priceCalculator;
     this.pizzaFactory    = pizzaFactory;
 }
Beispiel #3
0
 public virtual IPizzaPriceCalculator ChangePizzaPriceCalculator(IPizzaPriceCalculator calculator)
 {
     return(calculator);
 }
 public SalesTaxCalculator(IPizzaPriceCalculator replacedCalculator)
 {
     this.replacedCalculator = replacedCalculator;
 }
Beispiel #5
0
 public override IPizzaPriceCalculator ChangePizzaPriceCalculator(IPizzaPriceCalculator calculator)
 {
     return(new SalesTaxCalculator(calculator));
 }