Beispiel #1
0
        static void Main(string[] args)
        {
            Barbecuer boy = new Barbecuer();

            boy.BakeMutton();
            boy.BakeMutton();
            boy.BakeMutton();
            boy.BakeChickenWing();
            boy.BakeMutton();
            boy.BakeMutton();
            boy.BakeChickenWing();

            Console.Read();
        }
Beispiel #2
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();

        }
 public BakeChickenWingCommand(Barbecuer receiver)
     : base(receiver)
 {
 }
 public Command(Barbecuer receiver)
 {
     this.receiver = receiver;
 }
        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();
        }
 public BakeMuttonCommand(Barbecuer receiver)
     : base(receiver)
 {
 }
Beispiel #7
0
 public BakeChickenWingCommand(Barbecuer receiver)
     : base(receiver)
 {
 }
Beispiel #8
0
 public BakeMuttonCommand(Barbecuer receiver)
     : base(receiver)
 {
 }
Beispiel #9
0
 public Command(Barbecuer receiver)
 {
     this.receiver = receiver;
 }