Пример #1
0
 public Order(Pizzeria pizzeria, params Pizza[] pizzas)
 {
     Pizzas = pizzas;
     _totalOrders++;
     Number         = _totalOrders;
     OnCreateOrder += pizzeria.MakeOrder;
 }
Пример #2
0
        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();
        }
Пример #3
0
        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);
        }
Пример #4
0
        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();
        }