public Order(Pizzeria pizzeria, params Pizza[] pizzas) { Pizzas = pizzas; _totalOrders++; Number = _totalOrders; OnCreateOrder += pizzeria.MakeOrder; }
public void CreateOrder(Pizzeria pizzeria, params Pizza[] pizzas) { Order order = new Order(pizzeria, pizzas); OrderNumber = order.Number; order.OnReadyOrder += TakeOrder; Console.WriteLine($"{Name} made an order"); Console.WriteLine(new string('_', 25)); order.InitCreateOrder(); }
static void Main(string[] args) { Pizzeria pizzeria = new Pizzeria(); User Sam = new User("Sam"); Sam.CreateOrder(pizzeria, Pizza.Margarita); User Jack = new User("Jack"); Jack.CreateOrder(pizzeria, Pizza.Sicilian, Pizza.Neapolitan, Pizza.Hawaiian); User Ethan = new User("Ethan"); Ethan.CreateOrder(pizzeria, Pizza.Diabola); }
static void Main(string[] args) { Console.WriteLine("Hello World!"); Customer acc = new Customer(123); acc.Notify += DisplayMessage; Pizzeria dodo = new Pizzeria(); dodo.ProcessingPizza += DisplayMessage; dodo.IsReady += DisplayMessage; acc.AddToOrder(1); acc.AddToOrder(2); acc.AddToOrder(2); acc.RemoveToOrder(2); acc.RemoveToOrder(2); acc.PayOrder(); dodo.Cooking(); dodo.DisplayInfo(acc); acc.TakeOrder(); }