Ejemplo n.º 1
0
 //member methods (CAN DO)
 public void GenerateEachCustomer(Player player, Recipe recipe, Pitcher pitcher)
 {
     numberOfCustomers = GenerateRandomNumberOfCustomers();
     for (int i = 0; i < numberOfCustomers; i++)
     {
         customer = new Customer();
         //customer.RandomCustomerGenerator(random);
         customer.HowMuchLemonadeToBuy(player, weather, recipe, pitcher);
         pitcher.SoldCupOfLemonade(customer);
     }
 }
Ejemplo n.º 2
0
 //This method is not currently used anywhere, but will be called when I add functionality for changing popularity of the lemonade stand.
 public bool CustomerSatisfied(Pitcher pitcher)
 {
     if (pitcher.Taste <= tasteConstant + 2 && pitcher.Taste >= tasteConstant - 2)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 3
0
 // constructor (SPAWNER)
 public Player(string name)
 {
     pitcher   = new Pitcher();
     recipe    = new Recipe();
     this.name = name;
     inventory = new Inventory();
     wallet    = new Wallet();
     weeklyMoneyUsedOnSupplies = 0;
     weeklyProfitLoss          = 0;
     weeklySales = 0;
 }
        public void PurchaseLemonadeFromPlayer(Player player, Pitcher pitcher)
        {
            {
                customerMoney       -= player.recipe.pricePerCup;
                player.wallet.Money += player.recipe.pricePerCup;
                pitcher.cupsLeftInPitcher--;
                didPurchase = true;

                Console.WriteLine(name + " has decided to purchase cup of lemonade!");
            }
        }
Ejemplo n.º 5
0
 //Constuctor (spawn)
 public Game()
 {
     day       = new Day();
     store     = new Store();
     player    = new Player();
     inventory = new Inventory();
     days      = new List <Day>();
     customer  = new Customer();
     weather   = new Weather();
     pitcher   = new Pitcher();
     recipe    = new Recipe();
 }
Ejemplo n.º 6
0
        public void BuyLemonade(Player player, Recipe recipe, Pitcher pitcher)
        {
            bool index = random.Next(2) == 0;

            buyLemonade = index;
            pricePerCup = recipe.pricePerCup;
            if (buyLemonade == true && pitcher.numberOfCupsinPitcher <= 0)
            {
                player.MakeNewPitcher();
                PayForLemonade(recipe);
                player.wallet.GetMoneyFromCustomer(pricePerCup);
            }
        }
 public static void DisplayInventory(Inventory inventory, Pitcher pitcher)
 {
     Console.WriteLine("You have:\n" +
                       "  {0} Lemons" + "\n" +
                       "  {1} Sugar cubes" + "\n" +
                       "  {2} Ice Cubes" + "\n" +
                       "  {3} Cups" + "\n" +
                       "  {4} Cups in your pitcher",
                       inventory.lemons.Count,
                       inventory.sugarCubes.Count,
                       inventory.iceCubes.Count,
                       inventory.cups.Count,
                       pitcher.cupsLeftInPitcher);
 }
Ejemplo n.º 8
0
        // can do?

        public bool CanSellLemonade(Pitcher pitcher)
        {
            sellLemonade = false;

            do
            {
                if (pitcher.cupsLeftInPitcher <= 1)
                {
                    sellLemonade = false;
                    return(false);
                }
            } while (sellLemonade == true);
            return(true);
        }
Ejemplo n.º 9
0
        //constructors

        //member methods (CAN DO)
        public Game()
        {
            player    = new Player();
            recipe    = new Recipe();
            store     = new Store();
            inventory = new Inventory();
            weather   = new Weather();
            pitcher   = new Pitcher();
            days      = new List <Day>()
            {
                new Day("Sunday"), new Day("Monday"), new Day("Tuesday"), new Day("Wednesday"), new Day("Thursday"), new Day("Friday"), new Day("Saturday")
            };
            currentDay = 0;
            Console.WriteLine("The goal of the game is to make as much money as possible at the end of the work period. You will have complete control over how your business is ran. You will have to create a recipe at the beginning of the day. Keep in mind that your recipe should support your inventory to make it through the day. The next thing you will have to worry about s the weather which will play a part in if your customers will decide to buy from you.");
            Console.WriteLine("How long would you like to play?");
            ChooseLengthOfGame();
        }
Ejemplo n.º 10
0
        public void CreatePitcher()
        {
            try
            {
                if (inventory.lemons.Count <= 0 || inventory.sugarCubes.Count <= 0 || inventory.iceCubes.Count <= 0 || inventory.cups.Count <= 9)
                {
                    Console.WriteLine(" You dont have enough items in your inventory to create a pitcher. The key to a successful enterprise is proper preparation. Come back next week"); Console.ReadLine(); Environment.Exit(0);
                }
                else
                {
                    pitchercounter = UseRecipe(); Console.WriteLine("Would you like to create a new pitcher?");
                    string ans = Console.ReadLine().ToLower();
                    switch (ans)
                    {
                    case "y":
                    case "yes":
                    case "yeah":
                    case "yup":
                    case "1":
                    case "affirmative":
                    {
                        if (pitchercounter >= 1)
                        {
                            Console.WriteLine("There is still " + pitcher.cupsLeftInPitcher + " cups left in open picture, please use this before creating a new pitcher. "); Console.ReadLine();
                        }
                        else
                        {
                            pitcher = new Pitcher(); pitchercounter++; Console.WriteLine(" A new pitcher is created!! There is  " + pitchercounter + " pitchers, with  " + pitcher.cupsLeftInPitcher + " cups left ");
                        }
                        Console.ReadLine(); break;
                    }

                    default: { Console.WriteLine("You elected to not create Pitcher so mom made it for you"); pitcher = new Pitcher(); Console.ReadLine(); break; }
                    }
                }
            }
            catch (Exception) { Console.WriteLine(" Error. please enter a yes or no input "); UseRecipe(); }
        }
Ejemplo n.º 11
0
 public void GetCustomersToDecide(Player player, Weather weather, Random random, Pitcher pitcher)
 {
     foreach (Customer customer in customers)
     {
         player.KeepLemonadeStocked();
         customer.DecideToPurchase(player, weather, random, pitcher);
     }
     if (pitcher.cupsLeftInPitcher == 0)
     {
         Console.WriteLine("You ran out of inventory to make lemonade!");
     }
 }
Ejemplo n.º 12
0
 private void RecipeCreation()
 {
     pitcher = new Pitcher(player);
     UserInterface.DisplayCurrentInventoryAndMoney(player);
     SetLemonadePrice();
 }
Ejemplo n.º 13
0
 public void HowMuchLemonadeToBuy(Player player, Weather weather, Recipe recipe, Pitcher pitcher)
 {
     //random = new Random();
     if (weather.weatherCondition == weather.ListOfWeatherConditions[1])
     {
         if (weather.temperature >= 70)
         {
             if (recipe.pricePerCup <= 0.10)
             {
                 if (recipe.amountOfLemons >= 3)
                 {
                     amountOfLemonadeBuying = random.Next(3);
                     BuyLemonade(player, recipe, pitcher);
                 }
             }
         }
     }
     else if (weather.weatherCondition == weather.ListOfWeatherConditions[2])
     {
         if (weather.temperature >= 60)
         {
             if (recipe.pricePerCup <= 0.20)
             {
                 if (recipe.amountOfLemons >= 3)
                 {
                     amountOfLemonadeBuying = random.Next(5);
                     BuyLemonade(player, recipe, pitcher);
                 }
             }
         }
     }
     else if (weather.weatherCondition == weather.ListOfWeatherConditions[3])
     {
         if (weather.temperature >= 65)
         {
             if (recipe.pricePerCup <= 0.15)
             {
                 if (recipe.amountOfLemons >= 3)
                 {
                     amountOfLemonadeBuying = random.Next(4);
                     BuyLemonade(player, recipe, pitcher);
                 }
             }
         }
     }
     else if (weather.weatherCondition == weather.ListOfWeatherConditions[4] && weather.temperature >= 70 && recipe.pricePerCup <= 0.15 && recipe.amountOfLemons >= 5 && recipe.amountOfSugarCubes >= 5)
     {
         if (weather.temperature >= 80)
         {
             if (recipe.pricePerCup <= 0.25)
             {
                 if (recipe.amountOfLemons >= 5)
                 {
                     amountOfLemonadeBuying = random.Next(5);
                     BuyLemonade(player, recipe, pitcher);
                 }
             }
         }
     }
     else if (recipe.pricePerCup <= 0.10)
     {
         amountOfLemonadeBuying = random.Next(3);
         BuyLemonade(player, recipe, pitcher);
     }
     else
     {
         amountOfLemonadeBuying = random.Next(2);
         BuyLemonade(player, recipe, pitcher);
     }
 }
Ejemplo n.º 14
0
        //constructor

        public Pitcher()
        {
            Pitcher pitcher = new Pitcher();
            Recipe  recipe  = new Recipe();
        }
 public void AddPitcher(Pitcher pitcher)
 {
     supplies[4].Add(pitcher);
 }
Ejemplo n.º 16
0
 public void SetUpCurrentPitcher()
 {
     currentPitcher = new Pitcher();
     currentPitcher.MakeInitialBatchOfLemonade(player.MyRecipe, player.Inventory);
     currentPitcher.SetPricePerCup();
 }
Ejemplo n.º 17
0
 // constructor (SPAWNER)
 public Player()
 {
     inventory = new Inventory();
     wallet    = new Wallet();
     pitcher   = new Pitcher();
 }
Ejemplo n.º 18
0
 public void FillPitcher()
 {
     pitcher = new Pitcher();
     MakeRecipe();
     cupsLeftInPitcher--;
 }