Пример #1
0
        public int generatePurchaseChance(Lemonade recipe, Weather forcast)
        {
            int chanceToPurchase = randomSeed.Next(1, 20);

            if (forcast.getTempurature() > 75 && recipe.getIceCubes() > 2)
            {
                chanceToPurchase += 4;
            }

            double CTPDouble = ((recipe.getPrice() + 1) / 3);

            CTPDouble         = Math.Floor(CTPDouble);
            chanceToPurchase -= Convert.ToInt32(CTPDouble);

            int wateredDown = (recipe.getSugar() + recipe.getLemons()) - recipe.getIceCubes();

            if (wateredDown > 0)
            {
                chanceToPurchase += 2;
            }
            else
            {
                chanceToPurchase -= wateredDown;
            }

            return(chanceToPurchase);
        }
Пример #2
0
        public void displayPurchaseScreen(Player player, Weather forcast)
        {
            Inventory playerInventory = player.getInventory();

            Console.WriteLine("Inventory/Purchasing");
            Console.WriteLine("The Forcast for tomorrow is: " + forcast.getTempurature() + " and " + forcast.getWeather());
            Console.WriteLine("You have:");
            Console.WriteLine("$" + player.getMoney());
            Console.WriteLine(playerInventory.getCups() + " Paper Cups");
            Console.WriteLine(playerInventory.getNumOfLemons() + " Lemons");
            Console.WriteLine(playerInventory.getSugar() + " Cups of Sugar");
            Console.WriteLine(playerInventory.getIceCubes() + " Ice Cubes");
            Console.WriteLine("Would you like to:");
            Console.WriteLine("1. buy more cups.");
            Console.WriteLine("2. buy more Lemons.");
            Console.WriteLine("3. buy more sugar.");
            Console.WriteLine("4. buy more ice cubes");
            Console.WriteLine("5. Continue");
        }