Exemplo n.º 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();
        }
Exemplo n.º 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();

        }
Exemplo n.º 3
0
 public BakeChickenWingCommand(Barbecuer receiver)
     : base(receiver)
 {
 }
Exemplo n.º 4
0
 public Command(Barbecuer receiver)
 {
     this.receiver = receiver;
 }
Exemplo n.º 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.SetOrder(bakeMuttonCommand2);
            girl.SetOrder(bakeChickenWingCommand1);

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

            Console.Read();
        }
Exemplo n.º 6
0
 public BakeMuttonCommand(Barbecuer receiver)
     : base(receiver)
 {
 }
Exemplo n.º 7
0
 public BakeChickenWingCommand(Barbecuer receiver)
     : base(receiver)
 {
 }
Exemplo n.º 8
0
 public BakeMuttonCommand(Barbecuer receiver)
     : base(receiver)
 {
 }
Exemplo n.º 9
0
 public Command(Barbecuer receiver)
 {
     this.receiver = receiver;
 }