예제 #1
0
        public void CheckForCustomer(Player player, Pitcher pitcher, Inventory inventory, Weather weather)
        {
            int chance = dayRandom.Next(0, 100);

            if (chance <= 80 && !isRaining)
            {
                Customer customer = new Customer();
                customer.Randomize();
                if (customer.WillPurchase(player, weather, pitcher))
                {
                    BuyCup(player, pitcher, inventory);
                    if (customer.CheckingCustomerBuyingStatus(pitcher))
                    {
                        BuyCup(player, pitcher, inventory);
                    }
                    else
                    {
                        Console.WriteLine("No customer walk by...");
                    }
                }
            }
            else
            {
                Console.WriteLine("*The rain is pouring hard so no customer stop to buy any lemonade!*\n");
            }
        }