public override string Execute(string[] command, State state)
 {
     try
     {
         StateCustomer cust   = (StateCustomer)state;
         Table         lTable = cust.Context.Table;
         return(lTable.Menu.ToString());
     } catch (Exception e)
     {
         return("Could not convert current state to Customer State.");
     }
 }
Esempio n. 2
0
        public override string Execute(string[] command, State state)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine();

            try
            {
                StateCustomer cust = (StateCustomer)state;

                // Local Variables
                Order lOrder = cust.Context.Table.Order;

                // Adds item from menu to order
                lOrder.Items.RemoveAt(Int32.Parse(command[2]) - 1);

                return(sb.AppendLine($"Order Item {command[2]} has been removed from the order.").ToString());
            }
            catch (Exception e)
            {
                return(sb.AppendLine("Invalid Command Input.").ToString());
            }
        }
 private StateFactory()
 {
     CustomerState = new StateCustomer();
     KitchenState  = new StateKitchen();
     FOHState      = new StateFOH();
 }