Beispiel #1
0
        static void Main(string[] args)
        {
            Barbecuer barbecuer              = new Barbecuer();
            Command   bakeMuttonCommand1     = new BakeMuttonCommand(barbecuer);
            Command   bakeMuttonCommand2     = new BakeMuttonCommand(barbecuer);
            Command   bakeChikenWingCommand1 = new BakeChickenWingCommand(barbecuer);
            Waiter    waiter = new Waiter();

            waiter.SetOrder(bakeMuttonCommand1);
            waiter.Notify();
            waiter.SetOrder(bakeMuttonCommand2);
            waiter.Notify();
            waiter.SetOrder(bakeChikenWingCommand1);
            waiter.Notify();
        }
        static void Main(string[] args)
        {
            Barbecuer boy = new Barbecuer();
            Command   bakeMuttonCommand1      = new BakeChickenWingCommand(boy);
            Command   bakeMuttonCommand2      = new BakeChickenWingCommand(boy);
            Command   bakeChickenWingCommand1 = new BakeChickenWingCommand(boy);
            Waiter    girl = new Waiter();

            // 开始点菜
            girl.SetOrder(bakeMuttonCommand1);
            girl.SetOrder(bakeMuttonCommand2);

            girl.SetOrder(bakeChickenWingCommand1);

            // 点菜完毕,通知厨房
            girl.Notify();
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            //開店前的準備
            Barbecuer boy = new Barbecuer();
            Command   bakeMuttonCommand1      = new BakeMuttonCommand(boy);
            Command   bakeMuttonCommand2      = new BakeMuttonCommand(boy);
            Command   bakeChickenWingCommand1 = new BakeChickenWingCommand(boy);
            Waiter    girl = new Waiter();

            //開門營業
            girl.SetOrder(bakeMuttonCommand1);
            girl.Notify();
            girl.SetOrder(bakeMuttonCommand2);
            girl.Notify();
            girl.SetOrder(bakeChickenWingCommand1);
            girl.Notify();

            Console.Read();
        }
        static void Main(string[] args)
        {
            //开店前的准备
            Barbecuer boy = new Barbecuer();
            Command   bakeMuttonCommand1      = new BakeMuttonCommand(boy);
            Command   bakeMuttonCommand2      = new BakeMuttonCommand(boy);
            Command   bakeChickenWingCommand1 = new BakeChickenWingCommand(boy);
            Waiter    girl = new Waiter();

            //开门营业 顾客点菜
            girl.SetOrder(bakeMuttonCommand1);
            girl.SetOrder(bakeMuttonCommand2);
            girl.SetOrder(bakeChickenWingCommand1);

            //点菜完闭,通知厨房
            girl.Notify();

            Console.Read();
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            //开店前的准备
            Barbecuer boy = new Barbecuer();
            Command bakeMuttonCommand1 = new BakeMuttonCommand(boy);
            Command bakeMuttonCommand2 = new BakeMuttonCommand(boy);
            Command bakeChickenWingCommand1 = new BakeChickenWingCommand(boy);
            Waiter girl = new Waiter();

            //开门营业
            girl.SetOrder(bakeMuttonCommand1);
            girl.Notify();
            girl.SetOrder(bakeMuttonCommand2);
            girl.Notify();
            girl.SetOrder(bakeChickenWingCommand1);
            girl.Notify();

            Console.Read();

        }
        static void Main(string[] args)
        {
            //開店前的準備
            Barbecuer boy = new Barbecuer();
            Command bakeMuttonCommand1 = new BakeMuttonCommand(boy);
            Command bakeMuttonCommand2 = new BakeMuttonCommand(boy);
            Command bakeChickenWingCommand1 = new BakeChickenWingCommand(boy);
            Waiter girl = new Waiter();

            //開門營業 顧客點菜
            girl.SetOrder(bakeMuttonCommand1);
            girl.SetOrder(bakeMuttonCommand2);
            girl.SetOrder(bakeChickenWingCommand1);

            //點菜完閉,通知廚房
            girl.Notify();

            Console.Read();
        }