Ejemplo n.º 1
0
        private void buyCups()
        {
            UserInterface.displayWallet(player.Wallet);
            UserInterface.buyingCupsMenu();
            string input = Console.ReadLine();

            switch (input)
            {
            case "0":
                break;

            case "1":
                if (walletValidate(.94))
                {
                    UserInterface.displayMessage("Successfully bought 25 cups!");
                    player.Inventory.Cups.TotalNumberOfItem += 25;
                    player.Wallet -= .94;
                    buyCups();
                }
                else
                {
                    UserInterface.displayMessage("Inefficient funds!");
                    buyCups();
                }
                break;

            case "2":
                if (walletValidate(1.60))
                {
                    UserInterface.displayMessage("Successfully bought 50 cups!");
                    player.Inventory.Cups.TotalNumberOfItem += 50;
                    player.Wallet -= 1.60;
                    buyCups();
                }
                else
                {
                    UserInterface.displayMessage("Inefficient funds!");
                    buyCups();
                }
                break;

            case "3":
                if (walletValidate(3.02))
                {
                    UserInterface.displayMessage("Successfully bought 100 cups!");
                    player.Inventory.Cups.TotalNumberOfItem += 100;
                    player.Wallet -= 3.02;
                    buyCups();
                }
                else
                {
                    UserInterface.displayMessage("Inefficient funds!");
                    buyCups();
                }
                break;

            default:
                UserInterface.displayMessage("Invalid Entry!");
                buyCups();
                break;
            }
        }
Ejemplo n.º 2
0
        private void buySugar()
        {
            UserInterface.displayWallet(player.Wallet);
            UserInterface.buyingSugarMenu();
            string input = Console.ReadLine();

            switch (input)
            {
            case "0":
                break;

            case "1":
                if (walletValidate(.5))
                {
                    UserInterface.displayMessage("Successfully bought 8 cups of Sugar!");
                    player.Inventory.Sugar.TotalNumberOfItem += 8;
                    player.Wallet -= .5;
                    buySugar();
                }
                else
                {
                    UserInterface.displayMessage("Inefficient funds!");
                    buySugar();
                }
                break;

            case "2":
                if (walletValidate(1.60))
                {
                    UserInterface.displayMessage("Successfully bought 20 cups of Sugar!");
                    player.Inventory.Sugar.TotalNumberOfItem += 20;
                    player.Wallet -= 1.60;
                    buySugar();
                }
                else
                {
                    UserInterface.displayMessage("Inefficient funds!");
                    buySugar();
                }
                break;

            case "3":
                if (walletValidate(3.44))
                {
                    UserInterface.displayMessage("Successfully bought 48 cups of Sugar!");
                    player.Inventory.Sugar.TotalNumberOfItem += 48;
                    player.Wallet -= 3.44;
                    buySugar();
                }
                else
                {
                    UserInterface.displayMessage("Inefficient funds!");
                    buySugar();
                }
                break;

            default:
                UserInterface.displayMessage("Invalid Entry!");
                buySugar();
                break;
            }
        }
Ejemplo n.º 3
0
        private void buyIce()
        {
            UserInterface.displayWallet(player.Wallet);
            UserInterface.buyingIceMenu();
            string input = Console.ReadLine();

            switch (input)
            {
            case "0":
                break;

            case "1":
                if (walletValidate(.8))
                {
                    UserInterface.displayMessage("Successfully bought 100 ice cubes!");
                    player.Inventory.Ice.TotalNumberOfItem += 100;
                    player.Wallet -= .8;
                    buyIce();
                }
                else
                {
                    UserInterface.displayMessage("Inefficient funds!");
                    buyIce();
                }
                break;

            case "2":
                if (walletValidate(2.02))
                {
                    UserInterface.displayMessage("Successfully bought 250 ice cubes!");
                    player.Inventory.Ice.TotalNumberOfItem += 250;
                    player.Wallet -= 2.02;
                    buyIce();
                }
                else
                {
                    UserInterface.displayMessage("Inefficient funds!");
                    buyIce();
                }
                break;

            case "3":
                if (walletValidate(3.73))
                {
                    UserInterface.displayMessage("Successfully bought 500 ice cubes!");
                    player.Inventory.Ice.TotalNumberOfItem += 500;
                    player.Wallet -= 3.73;
                    buyIce();
                }
                else
                {
                    UserInterface.displayMessage("Inefficient funds!");
                    buyIce();
                }
                break;

            default:
                UserInterface.displayMessage("Invalid Entry!");
                buyIce();
                break;
            }
        }
Ejemplo n.º 4
0
        private void buyLemons()
        {
            UserInterface.displayWallet(player.Wallet);
            UserInterface.buyingLemonMenu();
            string input = Console.ReadLine();

            switch (input)
            {
            case "0":
                break;

            case "1":
                if (walletValidate(.72))
                {
                    UserInterface.displayMessage("Successfully bought 10 Lemons!");
                    player.Inventory.Lemons.TotalNumberOfItem += 10;
                    player.Wallet -= .72;
                    buyLemons();
                }
                else
                {
                    UserInterface.displayMessage("Inefficient funds!");
                    buyLemons();
                }
                break;

            case "2":
                if (walletValidate(2.11))
                {
                    UserInterface.displayMessage("Successfully bought 30 Lemons!");
                    player.Inventory.Lemons.TotalNumberOfItem += 30;
                    player.Wallet -= 2.11;
                    buyLemons();
                }
                else
                {
                    UserInterface.displayMessage("Inefficient funds!");
                    buyLemons();
                }
                break;

            case "3":
                if (walletValidate(4.40))
                {
                    UserInterface.displayMessage("Successfully bought 75 Lemons!");
                    player.Inventory.Lemons.TotalNumberOfItem += 75;
                    player.Wallet -= 4.40;
                    buyLemons();
                }
                else
                {
                    UserInterface.displayMessage("Inefficient funds!");
                    buyLemons();
                }
                break;

            default:
                UserInterface.displayMessage("Invalid Entry!");
                buyLemons();
                break;
            }
        }