public bool AddTopping(Topping topping) { if (CanAddMoreTopping() && !DoesToppingExist(topping, true)) { ToppingList.Add(topping); System.Console.WriteLine("added topping: " + topping.Type); return(true); } return(false); }
// protected abstract void AddCrust(Crust crust); // protected abstract void AddSize(Size size); public void AddDefaultToppings() { foreach (var topType in DefaultToppings) { // System.Console.WriteLine("topType:" + topType); // float price = PriceManager.Instance.getPrice(topType); // ToppingList.Add(new Topping(topType) { Price = price }); ToppingList.Add(new Topping(topType)); // foreach (var toppingObject in toppingPriceList) // { // if (toppingObject.Type == topType) // { // ToppingList.Add(toppingObject); // break; // } // } } }
// protected abstract void AddCrust(Crust crust); // protected abstract void AddSize(Size size); protected void AddDefaultToppings() { foreach (var topType in DefaultToppings) { float price = PriceManager.Instance.getPrice(topType); ToppingList.Add(new Topping(topType) { Price = price }); // foreach (var toppingObject in toppingPriceList) // { // if (toppingObject.Type == topType) // { // ToppingList.Add(toppingObject); // break; // } // } } }
public void AddTopping(Topping topping) { ToppingList.Add(topping); }