Example #1
0
        public static void ProcessOrder(Player player)
        {
            string item = UI.WhatStoreItemIsUserBuying();

            if (item != "cancel")
            {
                int amount = UI.HowManyItems("buy");
                Store.SellItems(item, amount, player);
            }
        }
Example #2
0
        public override void ChangeRecipe()
        {
            int    amount   = 0;
            string toChange = UI.WhatRecipeItemIsUserChanging();

            if (toChange == "price")
            {
                recipe.pricePerCup = UI.WhatPriceDoYouWantToCharge();
            }
            else if (toChange != "cancel")
            {
                amount = UI.HowManyItems("change the recipe to");
            }

            switch (toChange)
            {
            case "ice":
                if (amount <= inventory.ice)
                {
                    recipe.icePerCup = amount;
                }
                else
                {
                    UI.DisplayErrorNotEnoughInInventory();
                }
                break;

            case "lemons":
                if (amount <= inventory.lemons)
                {
                    recipe.lemonsPerPitcher = amount;
                }
                else
                {
                    UI.DisplayErrorNotEnoughInInventory();
                }
                break;

            case "sugar":
                if (amount <= inventory.sugar)
                {
                    recipe.sugarsPerPitcher = amount;
                }
                else
                {
                    UI.DisplayErrorNotEnoughInInventory();
                }
                break;

            default:
                break;
            }
        }