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); }
// Constructor public ConcreteCommand(PizzaMaker pizzaMaker) : base(pizzaMaker) { }
// Constructor public Command(PizzaMaker pizzaMaker) { this.pizzaMaker = pizzaMaker; }