Example #1
0
 public bool CheckInventory(Orangeade currentOrangeade)
 {
     if (soldOut)
     {
         return(false);
     }
     else if (cupsInPitcher == 0)
     {
         CreatePitcher(currentOrangeade);
         return(CheckInventory(currentOrangeade));
     }
     else if (cups.Count < 1)
     {
         soldOut = true;
         return(false);
     }
     else if (iceCubes.Count < currentOrangeade.Ice)
     {
         soldOut = true;
         return(false);
     }
     else
     {
         return(true);
     }
 }
Example #2
0
 public void ExchangeGoods(Orangeade currentOrangeade)
 {
     money += currentOrangeade.Cost;
     SubtractFromInventory(iceCubes, currentOrangeade.Ice);
     SubtractFromInventory(cups, 1);
     RemoveCupFromPitcher();
 }
Example #3
0
 public Player(string playerNumber, string playerName, int playerMoney, int playerOranges, int playerSugar, int playerIce, int playerCups, int recipieCost, int recipieOranges, int recipieSugar, int recipieIce, string recipiePulp)
 {
     number           = playerNumber;
     name             = playerName;
     currentOrangeade = new Orangeade(recipieCost, recipieOranges, recipieSugar, recipieIce, recipiePulp);
     inventory        = new Inventory(playerMoney, playerOranges, playerSugar, playerIce, playerCups);
     turnMenu         = new TurnMenu(name);
     purchaseMenu     = new PurchaseMenus();
 }
Example #4
0
 public Player(string playerNumber)
 {
     number = playerNumber;
     GetPlayerName();
     currentOrangeade = new Orangeade();
     inventory        = new Inventory();
     turnMenu         = new TurnMenu(name);
     purchaseMenu     = new PurchaseMenus();
 }
Example #5
0
 public Customer(Weather currentWeather, Orangeade currentOrangeade)
 {
     DetermineThirstLevel(currentWeather);
     DeterminePulpPreference();
     tartPreference  = DetermineModifiers();
     sweetPreference = DetermineModifiers();
     DetermineMaxPrice(currentWeather.temperature);
     CollectPurchaseChanceModifiers(currentOrangeade, currentWeather);
     CheckIfWillBuy(currentOrangeade);
 }
Example #6
0
 private void CreatePitcher(Orangeade currentOrangeade)
 {
     if (oranges.Count >= currentOrangeade.Oranges && sugars.Count >= currentOrangeade.Sugar)
     {
         cupsInPitcher = 8;
         SubtractFromInventory(oranges, currentOrangeade.Oranges);
         SubtractFromInventory(sugars, currentOrangeade.Sugar);
     }
     else
     {
         soldOut = true;
     }
 }
Example #7
0
        private void CheckIfWillBuy(Orangeade currentOrangeade)
        {
            int purchaseCheck;

            purchaseCheck = random.Next(1, 90);
            if (purchaseCheck < purchaseChance)
            {
                willBuy = maxPrice >= currentOrangeade.Cost ?  true : false;
            }
            else
            {
                willBuy = false;
            }
        }
Example #8
0
        private void CollectPurchaseChanceModifiers(Orangeade currentOrangeade, Weather currentWeather)
        {
            double tartModifier;
            double sweetModifier;
            double thirstModifier;
            double pulpModifier;
            double weatherModifier;
            double priceModifier;

            priceModifier   = DeterminePriceModifier(currentOrangeade.Cost);
            tartModifier    = CreatePurchaseChanceModifier(currentOrangeade.Tart, tartPreference);
            sweetModifier   = CreatePurchaseChanceModifier(currentOrangeade.Sweet, sweetPreference);
            thirstModifier  = CreatePurchaseChanceModifier(currentOrangeade.Refresh, thirstLevel);
            pulpModifier    = CreatePulpPreferenceModifier(currentOrangeade.Pulp, pulpPreference);
            weatherModifier = CreateWeatherModifier(currentWeather);
            purchaseChance  = (tartModifier + sweetModifier + thirstModifier + pulpModifier + weatherModifier + priceModifier);
        }
Example #9
0
 public void AddRecipie(Orangeade currentOrangeAde)
 {
     todaysOrangeade = currentOrangeAde;
 }