Beispiel #1
0
        static void Main(string[] args)
        {
            int pizza = MenuHelper.GetOrder();

            // Create receiver, command, and invoker

            PizzaMaker pizzaMaker = new PizzaMaker();
            Command    command    = new ConcreteCommand(pizzaMaker);
            Waiter     invoker    = new Waiter();

            // Set and execute command

            invoker.SetCommand(command);
            invoker.ExecuteCommand(pizza);
        }
Beispiel #2
0
        // Constructor

        public ConcreteCommand(PizzaMaker pizzaMaker) :
            base(pizzaMaker)
        {
        }
Beispiel #3
0
        // Constructor

        public Command(PizzaMaker pizzaMaker)
        {
            this.pizzaMaker = pizzaMaker;
        }