Example #1
0
        /// <summary>
        /// Produce Almindelig Hotdog Menu
        /// </summary>
        private void ProduceOrdinaryHotdog()
        {
            // Check on if any required ingredient are available.
            if (getBoiler.CookedSausageQueue.Count == 0)
            {
                // Cook new sausage batch if empty.
                Debug.WriteLine(INFO_MESSAGE + "Cooking sausage batch.");
                getBoiler.PrepareCookedSausageBatch();
            }
            if (getToaster.BurgerBunQueue.Count == 0)
            {
                // Cook sausage bread, if none ready.
                Debug.WriteLine(INFO_MESSAGE + "Roasting sausage bread.");
                getToaster.PrepareSausageBread();
            }
            if (ketchup.ServingsLeft == 0)
            {
                Debug.WriteLine(WARNING_MESSAGE + "Refilling Ketchup.");
                ketchup.Refill();
            }
            if (mustard.ServingsLeft == 0)
            {
                Debug.WriteLine(WARNING_MESSAGE + "Refilling Mustard.");
                mustard.Refill();
            }
            if (remoulade.ServingsLeft == 0)
            {
                Debug.WriteLine(WARNING_MESSAGE + "Refilling Remoulade.");
                remoulade.Refill();
            }

            // Get required ingredient for menu.
            getBoiler.TakeCookedSausage();
            getToaster.TakeSausageBread();

            // Apply Condiment for order.
            if (ketchup is Condiment && ketchup.ServingsLeft <= 30)
            {
                Debug.WriteLine($" ##################### Ketchup: {ketchup.ServingsLeft}");
                Condiment condiment = (Condiment)ketchup;
                condiment.ServingsLeftCounter();
            }
            if (mustard is Condiment && mustard.ServingsLeft <= 30)
            {
                Debug.WriteLine($" ##################### Mustard: {mustard.ServingsLeft}");
                Condiment condiment = (Condiment)mustard;
                condiment.ServingsLeftCounter();
            }
            if (remoulade is Condiment && remoulade.ServingsLeft <= 30)
            {
                Debug.WriteLine($" ##################### Remoulade: {remoulade.ServingsLeft}");
                Condiment condiment = (Condiment)remoulade;
                condiment.ServingsLeftCounter();
            }

            Debug.WriteLine(INFO_MESSAGE + (int)OrderList.OrdinaryHotdog);
            Thread.Sleep(threadSleep);
        }