Пример #1
0
        public void GetWhatToSell(int playerchoice, Player player, int indexOfStand)
        {
            LemmonadeStand standToSellTo = player.myFranchiseofStands[indexOfStand];

            if (playerchoice == 1)
            {
                SellPitchers(player, standToSellTo);
            }
            else if (playerchoice == 2)
            {
                SellLemons(player, standToSellTo);
            }
            else if (playerchoice == 3)
            {
                SellSugarCubes(player, standToSellTo);
            }
            else if (playerchoice == 4)
            {
                SellCups(player, standToSellTo);
            }
            else if (playerchoice == 5)
            {
                SellIceCubes(player, standToSellTo);
            }
        }
Пример #2
0
        public void SendInventorytoAdifferentLocation(LemmonadeStand givingLocation, LemmonadeStand receivingLocation, List <Item> listOfItemsToBeSubbedFrom, int AmountToBeSubbed)
        {
            //Call to the method in th invetory of the location that is giving the items to check if they can give the amount specified,if not aknowledge and then repromp if yes adjust levels of the
            //lists accordingly.
            bool cantheyDothis = false;

            while (!cantheyDothis)
            {
                break;
            }
        }
Пример #3
0
        public void SellCups(Player player, LemmonadeStand FranchiseToAddInventoryTo)
        {
            int    cupsToPurchase    = UserInterface.GetNumberOfItems(new Cup());
            double transactionAmount = CalculateTransactionAmount(cupsToPurchase, pricePerCup);

            if (player.wallet.Money >= transactionAmount)
            {
                PerformTransaction(player.wallet, transactionAmount);
                for (int i = 0; i < cupsToPurchase; i++)
                {
                    FranchiseToAddInventoryTo.inventoryOfthisStand.lemons.Add(new Cup());
                }
            }
        }
Пример #4
0
        public void SellPitchers(Player player, LemmonadeStand FranchiseToAddInventoryTo)
        {
            int    PitchersToPurchase = UserInterface.GetNumberOfItems(new Pitcher());
            double transactionAmount  = CalculateTransactionAmount(PitchersToPurchase, pricePerPitcher);

            if (player.wallet.Money >= transactionAmount)
            {
                PerformTransaction(player.wallet, transactionAmount);
                for (int i = 0; i < PitchersToPurchase; i++)
                {
                    FranchiseToAddInventoryTo.listOfPitchers.Add(new Pitcher());
                }
            }
        }
Пример #5
0
        // member methods (CAN DO)
        public void SellLemons(Player player, LemmonadeStand FranchiseToAddInventoryTo)
        {
            int    lemonsToPurchase  = UserInterface.GetNumberOfItems(new Lemon());
            double transactionAmount = CalculateTransactionAmount(lemonsToPurchase, pricePerLemon);

            if (player.wallet.Money >= transactionAmount)
            {
                PerformTransaction(player.wallet, transactionAmount);
                for (int i = 0; i < lemonsToPurchase; i++)
                {
                    FranchiseToAddInventoryTo.inventoryOfthisStand.lemons.Add(new Lemon());
                }
            }
            else
            {
                Console.WriteLine("Insufficient Funds");
            }
        }