Example #1
0
        public override void Execute(Order o)
        {
            StateFactory stateFactory = StateFactory.GetInstance;

            StateFOH stateFOH = (StateFOH)stateFactory.GetState("foh");

            stateFOH.WaitExceededOrders.Add(o);
        }
        public override string Execute(string[] command, State state)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine();

            StateFactory factory = StateFactory.GetInstance;
            StateFOH     foh     = (StateFOH)factory.GetState("foh");

            sb.AppendLine(foh.CompleteOrdersToString());

            return(sb.ToString());
        }
        public void CompleteOrder(int index)
        {
            KeyValuePair <Order, Timer> pair = OrderList.ElementAt(index - 1);
            Timer t = pair.Value;

            t.Stop();
            t.Dispose();
            OrderList.Remove(pair.Key);

            StateFactory stateFactory = StateFactory.GetInstance;
            StateFOH     foh          = (StateFOH)stateFactory.GetState("foh");

            pair.Key.Status = "Served";
            foh.CompleteOrders.Add(pair.Key);
        }
 private StateFactory()
 {
     CustomerState = new StateCustomer();
     KitchenState  = new StateKitchen();
     FOHState      = new StateFOH();
 }