private static void Main(string[] args)
        {
            Chef chef = new Chef();
            Command command1 = new BakeLampCommand(chef);
            Command command2 = new BakeLampCommand(chef);
            Command command3 = new BakeChickenWingCommand(chef);

            Waiter waiter = new Waiter();
            waiter.SetOrder(command1);
            waiter.Notify();

            waiter.SetOrder(command2);
            waiter.Notify();

            waiter.SetOrder(command3);
            waiter.Notify();

            Console.ReadLine(); //考虑调料?
        }
Esempio n. 2
0
        private static void Main(string[] args)
        {
            Chef    chef     = new Chef();
            Command command1 = new BakeLampCommand(chef);
            Command command2 = new BakeLampCommand(chef);
            Command command3 = new BakeChickenWingCommand(chef);

            Waiter waiter = new Waiter();

            waiter.SetOrder(command1);
            waiter.Notify();

            waiter.SetOrder(command2);
            waiter.Notify();

            waiter.SetOrder(command3);
            waiter.Notify();

            Console.ReadLine();             //考虑调料?
        }
Esempio n. 3
0
 public Command(Chef chef)
 {
     _chef = chef;
 }
Esempio n. 4
0
 public BakeChickenWingCommand(Chef chef)
     : base(chef)
 {
 }
 public Command(Chef chef)
 {
     _chef = chef;
 }
 public BakeLampCommand(Chef chef)
     : base(chef)
 {
 }
 public BakeChickenWingCommand(Chef chef)
     : base(chef)
 {
 }
 public BakeLampCommand(Chef chef)
     : base(chef)
 {
 }