示例#1
0
        public double amountOfIceCubesPurchased(int iceCubesNeededToBuy)
        {
            IceCubes iceCubes = new IceCubes();

            getIceCubes = iceCubes.pullCost() * iceCubesNeededToBuy;
            return(getIceCubes);
        }
示例#2
0
 public void AddInitialInventory()
 {
     lemons   = new Lemons();
     sugar    = new Sugar();
     iceCubes = new IceCubes();
     cups     = new Cups();
 }
示例#3
0
        public void PurchaseFromStore(Store store, Player player, Lemons lemons, IceCubes iceCubes, Sugar sugar, Cups cups)
        {
            string input               = "";
            string amountToPurchase    = "";
            int    amountToPurchaseInt = 0;

            while (input.ToLower() != "exit")
            {
                input = userInterface.GetStringInput("Type 'lemons' to buy lemons, 'ice' to buy ice cubes, 'sugar' to purchase cups of sugar, or 'cups' to purchase cups. Type 'exit' to finish purchasing");
                switch (input.ToLower())
                {
                case "lemons":
                    PurchaseLemons(store, player, lemons, amountToPurchase, amountToPurchaseInt);
                    break;

                case "ice":
                    PurchaseIce(store, player, iceCubes, amountToPurchase, amountToPurchaseInt);
                    break;

                case "sugar":

                    PurchaseSugar(store, player, sugar, amountToPurchase, amountToPurchaseInt);
                    break;

                case "cups":
                    PurchaseCups(store, player, cups, amountToPurchase, amountToPurchaseInt);
                    break;

                default:
                    break;
                }
            }
        }
示例#4
0
 //Constructor
 public Store(IceCubes iceCubes, Lemons lemons, Cups cups, Sugar sugar, Player playerOne)
 {
     this.iceCubes  = iceCubes;
     this.cups      = cups;
     this.sugar     = sugar;
     this.lemons    = lemons;
     this.playerOne = playerOne;
 }
示例#5
0
 public void AddingIceCubes(Player player)
 {
     for (int i = 0; i < player.numberOfItemsBought; i++)
     {
         IceCubes IceCubes = new IceCubes();
         storingIceCubes.Add(1);
     }
 }
示例#6
0
 public Store(Player player)
 {
     this.player = player;
     lemons      = new Lemons();
     sugar       = new Sugar();
     ice         = new IceCubes();
     cups        = new Cups();
 }
示例#7
0
 public void submitIceCubes(int AmountOfIceCubesNeeded)
 {
     for (int i = 0; i < AmountOfIceCubesNeeded; i++)
     {
         IceCubes iceCubes = new IceCubes();
         this.iceCubes.Add(iceCubes);
     }
     Console.WriteLine("Right now you have {0} of ice .", iceCubes.Count);
 }
示例#8
0
 public void PurchaseIce(Store store, Player player, IceCubes iceCubes, string amountToPurchase, int amountToPurchaseInt)
 {
     amountToPurchase = userInterface.DisplayStoreItem(store.iceCubes, store.iceCubesPrices, store.iceCubesAmount);
     if (amountToPurchase != "0")
     {
         amountToPurchaseInt = Int32.Parse(amountToPurchase);
         player.WithDrawMoney(store.iceCubesPrices[amountToPurchaseInt - 1]);
         AdjustIceCubesAmount(store, iceCubes, amountToPurchaseInt, store.iceCubesAmount[amountToPurchaseInt - 1]);
     }
 }
示例#9
0
        //Constructor

        public Game()
        {
            iceCubes      = new IceCubes();
            lemons        = new Lemons();
            sugar         = new Sugar();
            cups          = new Cups();
            weather       = new Weather();
            playerOne     = new Player();
            itemStore     = new Store(iceCubes, lemons, cups, sugar, playerOne);
            userInterface = new UserInterface(playerOne, weather);
            day           = new Day(playerOne, weather, customer);
        }
示例#10
0
 //constructor
 public Game()
 {
     store         = new Store();
     userInterface = new UserInterface();
     // weather = new Weather();
     player             = new Player();
     amountOfDaysInGame = 0;
     dayNumber          = 1;
     lemons             = new Lemons();
     sugar    = new Sugar();
     iceCubes = new IceCubes();
     cups     = new Cups();
 }
示例#11
0
        public void RunDay(Store store, Player player, int dayNumber, Lemons lemons, IceCubes iceCubes, Sugar sugar, Cups cups)
        {
            moneyInWalletAtStart = player.Money;

            weather.DetermineForecast();
            userInterface.DisplayBeginningOfDayInfo(weather.forecast, weather.highTemperatureForecast, dayNumber, player.Money);
            userInterface.ShowRecipe(lemonsPerPitcher, cupsSugarPerPitcher, iceCubesPerGlass, pricePerCup);
            ChangeRecipe();
            userInterface.ShowRecipe(lemonsPerPitcher, cupsSugarPerPitcher, iceCubesPerGlass, pricePerCup);
            PurchaseFromStore(store, player, lemons, iceCubes, sugar, cups);
            userInterface.DisplayInventory(cups.currentStock, lemons.currentStock, sugar.currentStock, iceCubes.currentStock);
            DetermineGlassesPerPitcher();
            DeterminePotentialCustomers();
            DetermineCupsSold();
            AddProfit(player);
            player.FindProfit(moneyInWalletAtStart);
            lemons.DecreaseInventory(cupsSold, pitcherLooper, lemonsPerPitcher);
            sugar.DecreaseInventory(cupsSold, pitcherLooper, cupsSugarPerPitcher);
            cups.DecreaseInventory(cupsSold);
            iceCubes.DecreaseInventory(cupsSold, iceCubesPerGlass);

            GetPopularity();
            userInterface.DisplayEndOfDayInfo(CheckForSoldOut(iceCubes.currentStock, lemons.currentStock, sugar.currentStock, cups.currentStock), weather.forecast, weather.highTemperatureForecast, dayNumber, player.Money, player.Profit, cupsSold, popularity);
        }
示例#12
0
 public int AdjustIceCubesAmount(Store store, IceCubes iceCubes, int amountToPurchaseInt, int itemsToAdd)
 {
     iceCubes.currentStock += itemsToAdd;
     return(iceCubes.currentStock);
 }