Example #1
0
        public void ChoosingIceCubes(Player player, Inventory inventory, Wallet wallet)
        {
            Console.WriteLine("Type in the number of ice cubes you want to buy");
            option = Console.ReadLine();
            switch (option)
            {
            case "100":
                Console.WriteLine("You bought 100 ice cubes.");
                player.numberOfItemsBought = 100;
                cost = priceOf100IceCubes;
                wallet.ValidatingFunds(player, cost);
                inventory.AddingIceCubes(player);
                buyingMore(player, inventory, wallet);
                break;

            case "250":
                Console.WriteLine("You bought 250 ice cubes.");
                player.numberOfItemsBought = 250;
                cost = priceOf250IceCubes;
                wallet.ValidatingFunds(player, cost);
                inventory.AddingIceCubes(player);
                buyingMore(player, inventory, wallet);
                break;

            case "500":
                Console.WriteLine("You bought 500 ice cubes.");
                player.numberOfItemsBought = 500;
                cost = priceOf500IceCubes;
                wallet.ValidatingFunds(player, cost);
                inventory.AddingIceCubes(player);
                buyingMore(player, inventory, wallet);
                break;

            default:
                Console.WriteLine("You typed in something wrong.");
                ChoosingIceCubes(player, inventory, wallet);
                break;
            }
        }
Example #2
0
        public void ChoosingLemons(Player player, Inventory inventory, Wallet wallet)
        {
            Console.WriteLine("Type in the number of lemons you want to buy");
            option = Console.ReadLine();
            switch (option)
            {
            case "10":
                Console.WriteLine("You bought 10 lemons.");
                player.numberOfItemsBought = 10;
                cost = priceOf10Lemons;
                wallet.ValidatingFunds(player, cost);
                inventory.AddingLemons(player);
                buyingMore(player, inventory, wallet);
                break;

            case "30":
                Console.WriteLine("You bought 30 lemons.");
                player.numberOfItemsBought = 30;
                cost = priceOf30Lemons;
                wallet.ValidatingFunds(player, cost);
                inventory.AddingLemons(player);
                buyingMore(player, inventory, wallet);
                break;

            case "75":
                Console.WriteLine("You bought 75 lemons.");
                player.numberOfItemsBought = 75;
                cost = priceOf75Lemons;
                wallet.ValidatingFunds(player, cost);
                inventory.AddingLemons(player);
                buyingMore(player, inventory, wallet);
                break;

            default:
                Console.WriteLine("You typed in something wrong.");
                ChoosingLemons(player, inventory, wallet);
                break;
            }
        }
Example #3
0
        public void ChoosingSugar(Player player, Inventory inventory, Wallet wallet)
        {
            Console.WriteLine("Type in the number of cups of sugar you want to buy");
            option = Console.ReadLine();
            switch (option)
            {
            case "8":
                Console.WriteLine("You bought 8 cups of sugar.");
                player.numberOfItemsBought = 8;
                cost = priceOf8CupsSugar;
                wallet.ValidatingFunds(player, cost);
                inventory.AddingSugar(player);
                buyingMore(player, inventory, wallet);
                break;

            case "20":
                Console.WriteLine("You bought 20 cups of sugar.");
                player.numberOfItemsBought = 20;
                cost = priceOf20CupsSugar;
                wallet.ValidatingFunds(player, cost);
                inventory.AddingSugar(player);
                buyingMore(player, inventory, wallet);
                break;

            case "48":
                Console.WriteLine("You bought 48 cups of sugar.");
                player.numberOfItemsBought = 48;
                cost = priceOf48CupsSugar;
                wallet.ValidatingFunds(player, cost);
                inventory.AddingSugar(player);
                buyingMore(player, inventory, wallet);
                break;

            default:
                Console.WriteLine("You typed in something wrong.");
                ChoosingSugar(player, inventory, wallet);
                break;
            }
        }