public void WrapUpPeriod(int periodNumber, LemonadeStandOwner player) { if (player.GetType() != typeof(Computer)) { PrintPeriodResults(periodNumber, player.customersServedThisPeriod, todayCustomerTraffic / periodsPerDay, player.cupsSoldThisPeriod, player); } player.customersServedThisPeriod = 0; player.cupsSoldThisPeriod = 0; }
private void PrintDayResults(LemonadeStandOwner player) { if (players.Count > 1) { UI.ClearPrint($"{player.name}'s results"); Console.ReadLine(); } Console.WriteLine($"You sold {player.cupsSoldToday} cups to {player.customersServedToday} customers.\n"); Console.WriteLine($"Today's revenue: ${player.moneyEarnedToday}\nToday's costs: ${player.moneySpentToday}\nToday's net profit: ${player.moneyEarnedToday - player.moneySpentToday}"); Console.WriteLine($"Total revenue: ${player.moneyEarnedTotal}\nTotal costs: ${player.moneySpentTotal}\nTotal net profit: ${player.moneyEarnedTotal - player.moneySpentTotal}"); Console.WriteLine($"Today's Customer Satisfaction: {player.todayCustomerSatisfaction}\nPopularity: {player.popularity}"); Console.ReadLine(); }
public void WrapUpDay(LemonadeStandOwner player) { player.moneyEarnedTotal += player.moneyEarnedToday; player.moneySpentTotal += player.moneySpentToday; player.popularity += player.todayCustomerSatisfaction; UI.ClearPrint($"Day {dayCounter} results"); PrintDayResults(player); player.SpoilItems(); player.moneyEarnedToday = 0; player.moneySpentToday = 0; player.cupsSoldToday = 0; player.customersServedToday = 0; player.todayCustomerSatisfaction = 0; }
private void ShortageAlert(LemonadeStandOwner player) { if (player.inventory[0].amountOwned <= 0) { Console.WriteLine("You're out of cups!"); } if (player.inventory[1].amountOwned < player.currentRecipe.lemonsPerPitcher) { Console.WriteLine("You don't have enough lemons to make another pitcher!"); } if (player.inventory[2].amountOwned < player.currentRecipe.sugarPerPitcher) { Console.WriteLine("You don't have enough sugar to make another pitcher!"); } if (player.inventory[3].amountOwned < player.currentRecipe.icePerCup) { Console.WriteLine("You don't have enough ice to pour another cup!"); } }
public void RunPeriods(LemonadeStandOwner player) { if (players.Count > 1) { UI.ClearPrint($"{player.name}'s turn."); Console.ReadLine(); } for (int i = 1; i <= periodsPerDay; i++) { StartPeriod(i, player); ShortageAlert(player); //customer loop for (int j = 0; j < (todayCustomerTraffic + player.popularity) / periodsPerDay; j++) { customer = new Customer(randomizer); if (player.lemonadeCupPrice <= SetCustomerPrice()) { player.ServeCustomer(customer.cupsDesired); player.todayCustomerSatisfaction = customer.GetSatisfaction(player.currentRecipe.lemonsPerPitcher, player.currentRecipe.sugarPerPitcher, player.currentRecipe.icePerCup); } } WrapUpPeriod(i, player); } }
public void StartPeriod(int periodNumber, LemonadeStandOwner player) { UI.ClearPrint($"Begin Period {periodNumber}"); Console.WriteLine($"It is {today.actualWeather.name}\nIt is {today.actualTemperature} degrees"); player.ChangePrice(); }
private void PrintPeriodResults(int periodNumber, int customersServed, int TotalCustomers, int cupsSold, LemonadeStandOwner player) { Console.WriteLine($"{TotalCustomers} people pass {player.name}'s Lemonade Stand."); Console.WriteLine($"{customersServed} people purchase your lemonade.\nThey buy {cupsSold} cups of lemonade, bringing your funds to {player.money}\n"); player.PrintInventory(); Console.ReadLine(); }