public async static Task Main(string[] args) { var cartCommand = new CartCommand(new CartCommandHandler()); var orderCommand = new OrderCommand(new OrderCommandHandler()); var store = new Store(cartCommand, orderCommand); await store.AddToCart(1, 2); await store.PlaceOrder(3, 4); Console.ReadKey(); }
public void ExecuteCommand(OrderCommand command, MenuItem item) { command.Execute(this.currentItems, item); }
public void SetCommand(int commandOption) { _orderCommand = new CommandFactory().GetCommand(commandOption); }