public Pizza DeleteDecoration(Type type) { if (PreviousPizza != null) { if (this.GetType() == type) { return(PreviousPizza); } PreviousPizza = PreviousPizza.DeleteDecoration(type); } return(this); }
public override int GetCost() { //Console.Write("[Tomato]"); // To check the correctness of the algorithm. return(PreviousPizza.GetCost() + 3); }