Пример #1
0
        public void ChooseItemToPurchase(Purse purse)
        {
            Console.WriteLine("\nWhat would you like to purchase? (L)emons, (I)ce, (C)ups, (S)ugar, (R)eturn to MainMenu or Show in(V)entory");
            string userInput = Console.ReadLine().ToLower();

            if (userInput == "l")
            {
                BuyLemons(purse);
            }
            else if (userInput == "i")
            {
                BuyIce(purse);
            }
            else if (userInput == "c")
            {
                BuyCups(purse);
            }
            else if (userInput == "s")
            {
                BuySugar(purse);
            }
            else if (userInput == "v")
            {
                ShowInventory(purse.playerMoney);
            }
            else if (userInput == "r")
            {
                return;
            }
        }
Пример #2
0
        public void MakePitcher(Pitcher pitcher, Purse purse)
        {
            ShowInventory(purse.playerMoney);
            Console.WriteLine("\nHow many pitchers would you like to make?");
            string pitchers       = Console.ReadLine();
            int    pitchersToMake = Convert.ToInt16(pitchers);

            CreatePitchers(pitchersToMake);
        }
Пример #3
0
        public void BuySugar(Purse purse)
        {
            Sugar tempSugar = new Sugar();

            ShowInventory(purse.playerMoney);
            Console.WriteLine("\nHow much {1} would you like to buy at {0:0.00} Each?", tempSugar.sugarCost, Sugar.itemName);
            string items           = Console.ReadLine();
            double itemsToPurchase = CheckForNumber(items);

            if (purse.CheckOverdraw(itemsToPurchase, tempSugar.sugarCost))
            {
                for (int i = 0; i < itemsToPurchase; i++)
                {
                    Sugar newSugar = new Sugar();
                    playerSugar.Add(newSugar);
                }
                purse.WithdrawMoney(itemsToPurchase, tempSugar.sugarCost, Sugar.itemName);
            }
            ChooseItemToPurchase(purse);
        }
Пример #4
0
        public void BuyCups(Purse purse)
        {
            Cup tempCup = new Cup();

            ShowInventory(purse.playerMoney);
            Console.WriteLine("\nHow many {1}s would you like to buy at {0:0.00} Each?", tempCup.cupCost, Cup.itemName);
            string items           = Console.ReadLine();
            double itemsToPurchase = CheckForNumber(items);

            if (purse.CheckOverdraw(itemsToPurchase, tempCup.cupCost))
            {
                for (int i = 0; i < itemsToPurchase; i++)
                {
                    Cup newCup = new Cup();
                    playerCups.Add(newCup);
                }
                purse.WithdrawMoney(itemsToPurchase, tempCup.cupCost, Cup.itemName);
            }
            ChooseItemToPurchase(purse);
        }
Пример #5
0
        public void BuyLemons(Purse purse)
        {
            Lemon tempLemon = new Lemon();

            ShowInventory(purse.playerMoney);
            Console.WriteLine("\nHow many {1}s would you like to buy at {0:0.00} Each?", tempLemon.lemonsCost, Lemon.itemName);
            string items           = Console.ReadLine();
            double itemsToPurchase = CheckForNumber(items);

            if (purse.CheckOverdraw(itemsToPurchase, tempLemon.lemonsCost))
            {
                for (int i = 0; i < itemsToPurchase; i++)
                {
                    Lemon newLemon = new Lemon();
                    playerLemons.Add(newLemon);
                }
                purse.WithdrawMoney(itemsToPurchase, tempLemon.lemonsCost, Lemon.itemName);
            }
            ChooseItemToPurchase(purse);
        }
Пример #6
0
 public Player(string playerName)
 {
     playerPurse     = new Purse();
     playerInventory = new Inventory();
 }