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); } }
public void ExchangeGoods(Orangeade currentOrangeade) { money += currentOrangeade.Cost; SubtractFromInventory(iceCubes, currentOrangeade.Ice); SubtractFromInventory(cups, 1); RemoveCupFromPitcher(); }
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(); }
public Player(string playerNumber) { number = playerNumber; GetPlayerName(); currentOrangeade = new Orangeade(); inventory = new Inventory(); turnMenu = new TurnMenu(name); purchaseMenu = new PurchaseMenus(); }
public Customer(Weather currentWeather, Orangeade currentOrangeade) { DetermineThirstLevel(currentWeather); DeterminePulpPreference(); tartPreference = DetermineModifiers(); sweetPreference = DetermineModifiers(); DetermineMaxPrice(currentWeather.temperature); CollectPurchaseChanceModifiers(currentOrangeade, currentWeather); CheckIfWillBuy(currentOrangeade); }
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; } }
private void CheckIfWillBuy(Orangeade currentOrangeade) { int purchaseCheck; purchaseCheck = random.Next(1, 90); if (purchaseCheck < purchaseChance) { willBuy = maxPrice >= currentOrangeade.Cost ? true : false; } else { willBuy = false; } }
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); }
public void AddRecipie(Orangeade currentOrangeAde) { todaysOrangeade = currentOrangeAde; }