Exemple #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);
        }
Exemple #2
0
        // Constructor

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

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