コード例 #1
0
ファイル: Person.cs プロジェクト: iZeQure/MikkelsSausage
        /// <summary>
        /// Produce Kogt Pølse med Brød Menu.
        /// </summary>
        private void ProduceCookedSausageWithBread()
        {
            if (getBoiler.CookedSausageQueue.Count == 0)
            {
                Debug.WriteLine(INFO_MESSAGE + "Cooking sausage batch.");
                getStove.PrepareRoastedSausage();
            }
            if (getToaster.SausageBreadQueue.Count == 0)
            {
                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();
            }

            getBoiler.TakeCookedSausage();
            getToaster.TakeSausageBread();

            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.RoastedHotdog);
            Thread.Sleep(threadSleep);
        }