public void SetCakeType(string Name) { CakeBase cb = getCakeBaseByName(Name); if (currentCake == null) { if (!(cb is ToppingBase)) { currentCake = cb.Copy(); } } }
public void AddToppingBase(string Name) { Console.WriteLine(Name); CakeBase cb = getCakeBaseByName(Name); if (cb != null) { if (currentCake != null) { if (cb is ToppingBase) { CakeBase cbCopy = cb.Copy(); ((ToppingBase)cbCopy).NextBase = currentCake.Copy(); currentCake = cbCopy; } } } }