void OnEnable() { Debug.Log ("------------------"); Debug.Log ("DECORATOR DESIGN PATTERN"); // Make Pizzas: IPizza basicPizza = new TomatoSauce(new Mozzarella(new PlainPizza())); Debug.Log ("Ingredients of Pizza: " + basicPizza.GetDescription()); Debug.Log ("Total Cost: " + basicPizza.GetCost()); }
void OnEnable() { Debug.Log("------------------"); Debug.Log("DECORATOR DESIGN PATTERN"); // Make Pizzas: IPizza basicPizza = new TomatoSauce(new Mozzarella(new PlainPizza())); Debug.Log("Ingredients of Pizza: " + basicPizza.GetDescription()); Debug.Log("Total Cost: " + basicPizza.GetCost()); }
static void Main(string[] args) { Pizza basicPizza = new TomatoSauce(new Mozzarella(new PlainPizza())); Console.WriteLine($"Ingredients : {basicPizza.GetDescription()}"); Console.WriteLine($"Price : {basicPizza.GetCost()}"); Console.ReadKey(); }