public Italian() { Ingridients.Add("cheese"); Ingridients.Add("tomatos"); Ingridients.Add("olives"); Ingridients.Add("meat"); }
public PizzaDecorator(Pizza pizza, params IIngridient[] addedIngrids) { _pizza = pizza; Ingridients = _pizza.Ingridients.GetRange(0, _pizza.Ingridients.Count); foreach (var ingrid in addedIngrids) { _ingridient = ingrid; if (_ingridient.GetType() == typeof(CakeLayer)) { throw new ArgumentException("Нельзя добавить второй корж"); } Ingridients.Add(_ingridient.GetType()); if (Ingridients.Count % 7 == 0) { discount *= 0.9; } _addedCost += _ingridient.GetCost(); _addedDescription += $" {_ingridient.GetDescription()} + "; } }
public Carbonara() { Ingridients.Add("cheese"); Ingridients.Add("tomatos"); }
public Margarita() { Ingridients.Add("cheese"); Ingridients.Add("tomatos"); Ingridients.Add("olives"); }
public void Add(Vegetable vegetable) { Ingridients.Add(vegetable); }
public Pepperoni() { Ingridients.Add("cheese"); Ingridients.Add("tomatos"); Ingridients.Add("meat"); }