Esempio n. 1
0
        public int GetAmountOfSugarUsedInRecipe(Inventory inventory)
        {
            UserInterface.SugarRecipePrompt();
            int sugarPerPitcher;

            while (!int.TryParse(Console.ReadLine(), out sugarPerPitcher) || sugarPerPitcher > inventory.SugarCount || sugarPerPitcher <= 0)
            {
                UserInterface.InvalidSugarRecipeEntry();
            }
            return(sugarPerPitcher);
        }