Example #1
0
 public void AddInitialInventory()
 {
     lemons   = new Lemons();
     sugar    = new Sugar();
     iceCubes = new IceCubes();
     cups     = new Cups();
 }
Example #2
0
        public List <Cups> SellCups(int itemsBeingSold, Bank bank)
        {
            List <Cups> newCups = new List <Cups>();
            Cups        cups    = new Cups();

            if (itemsBeingSold != 50)
            {
                for (int i = 0; i < itemsBeingSold; i++)
                {
                    if (bank.SubtractMoney(cups.GetCost()))
                    {
                        newCups.Add(new Cups());
                    }
                }
            }
            else
            if (bank.SubtractMoney(cups.GetBulkCost()))
            {
                for (int i = 0; i < itemsBeingSold; i++)
                {
                    newCups.Add(new Cups());
                }
            }
            return(newCups);
        }
Example #3
0
        public double amountOfCupsPurchased(int amountOfCupsNeeded)
        {
            Cups cups = new Cups();

            getCups = cups.pullCost() * amountOfCupsNeeded;
            return(getCups);
        }
        public void BuyCups()
        {
            Console.WriteLine("\nHow many cups would you like to buy?");
            string cupsAmountInput = Console.ReadLine();

            int.TryParse(cupsAmountInput, out buyCupsAmount);

            if (wallet.amountOfMoney - (costOfCups * buyCupsAmount) > costOfCups)
            {
                inventory.inventoryCupsCount += buyCupsAmount;
                //wallet.amountOfMoney = wallet.amountOfMoney - (costOfCups * buyCupsAmount);
                Console.WriteLine("You bought {0} cups.", buyCupsAmount);
            }
            else if (wallet.amountOfMoney < (costOfCups * buyCupsAmount))
            {
                Console.WriteLine("Insufficient Funds");
                Console.ReadLine();
                BuyCups();
            }
            for (int l = 0; l < buyCupsAmount; l++)
            {
                Cups cups = new Cups();
                inventory.inventoryCups.Add(cups);
            }
        }
Example #5
0
 public Store(Player player)
 {
     this.player = player;
     lemons      = new Lemons();
     sugar       = new Sugar();
     ice         = new IceCubes();
     cups        = new Cups();
 }
Example #6
0
 //Constructor
 public Store(IceCubes iceCubes, Lemons lemons, Cups cups, Sugar sugar, Player playerOne)
 {
     this.iceCubes  = iceCubes;
     this.cups      = cups;
     this.sugar     = sugar;
     this.lemons    = lemons;
     this.playerOne = playerOne;
 }
Example #7
0
 // Constructors
 public Store()
 {
     cups   = new Cups();
     lemons = new Lemons();
     sugar  = new Sugar();
     ice    = new Ice();
     Console.WriteLine("Initialized Store.");
 }
Example #8
0
 public void RemoveCups(double Number)
 {
     for (double i = 0; i < Number; i++)
     {
         Cups cups = new Cups();
         CupsList.RemoveAt(0);
     }
 }
Example #9
0
 public void AddCups(double Number)
 {
     for (double i = 0; i < Number; i++)
     {
         Cups cups = new Cups();
         CupsList.Add(cups);
     }
 }
Example #10
0
 public void AddingCups(Player player)
 {
     for (int i = 0; i < player.numberOfItemsBought; i++)
     {
         Cups Cups = new Cups();
         storingCups.Add(1);
     }
 }
Example #11
0
 public void AddCupsToInventory(int amountOfCups)
 {
     for (int i = 0; i < amountOfCups; i++)
     {
         Cups cups = new Cups();
         player.inventory.cups.Add(cups);
     }
 }
Example #12
0
        public void submitCups(int AmountOfCupsNeeded)

        {
            for (int i = 0; i < AmountOfCupsNeeded; i++)
            {
                Cups cups = new Cups();
                this.cups.Add(cups);
            }
        }
Example #13
0
        public void BuyCupsMath(string amountToBuy)
        {
            for (int i = 0; i < int.Parse(amountToBuy); i++)
            {
                Cups cups = new Cups();
                cupsInventory.Add(cups);
            }

            Console.WriteLine("You now have " + cupsInventory.Count + " cups");
        }
Example #14
0
 public void PurchaseCups(Store store, Player player, Cups cups, string amountToPurchase, int amountToPurchaseInt)
 {
     amountToPurchase = userInterface.DisplayStoreItem(store.paperCups, store.paperCupsPrices, store.paperCupsAmount);
     if (amountToPurchase != "0")
     {
         amountToPurchaseInt = Int32.Parse(amountToPurchase);
         player.WithDrawMoney(store.paperCupsPrices[amountToPurchaseInt - 1]);
         AdjustCupsAmount(store, cups, amountToPurchaseInt, store.paperCupsAmount[amountToPurchaseInt - 1]);
     }
 }
Example #15
0
        //Constructor

        public Game()
        {
            iceCubes      = new IceCubes();
            lemons        = new Lemons();
            sugar         = new Sugar();
            cups          = new Cups();
            weather       = new Weather();
            playerOne     = new Player();
            itemStore     = new Store(iceCubes, lemons, cups, sugar, playerOne);
            userInterface = new UserInterface(playerOne, weather);
            day           = new Day(playerOne, weather, customer);
        }
Example #16
0
        public Inventory()
        {
            totalInventory = new int[4];
            MyBananas      = new Bananas(5);
            MyBugs         = new Bugs(3);
            MyIce          = new Ice(3);
            MyCups         = new Cups(35);

            totalInventory[0] = MyBananas.quantity;
            totalInventory[1] = MyBugs.quantity;
            totalInventory[2] = MyIce.quantity;
            totalInventory[3] = MyCups.quantity;
        }
Example #17
0
 //constructor
 public Game()
 {
     store         = new Store();
     userInterface = new UserInterface();
     // weather = new Weather();
     player             = new Player();
     amountOfDaysInGame = 0;
     dayNumber          = 1;
     lemons             = new Lemons();
     sugar    = new Sugar();
     iceCubes = new IceCubes();
     cups     = new Cups();
 }
Example #18
0
        public void SellCups()
        {
            Console.WriteLine("How many cups would you like to buy?");

            int boughtCups = int.Parse(Console.ReadLine());

            for (i = 0; i < boughtCups; i++)
            {
                Cups cups = new Cups();
            }
            Player.inventory.ice.Add(ice);

            Player.wallet.cash -= (boughtCups * Player.inventory.cups[1].price);
        }
Example #19
0
        public void BuyCups(Store store)
        {
            Console.WriteLine("How many cups do you want: ");
            int cupsAmount = Convert.ToInt32(Console.ReadLine());

            capital = capital - (cupsAmount * store.cupsPrice);
            Console.WriteLine("You have " + capital);

            for (int i = 0; i < cupsAmount; i++)
            {
                Cups cups = new Cups();
                inventory.cupsList.Add(cups);
            }
            Console.WriteLine("Your inventory now has " + inventory.cupsList.Count + "cups");
        }
Example #20
0
        public void Item()
        {//subtract amount from wallet
            Lemons lemons = new Lemons("10- $1, 20- $2, 50- $5");
            Sugar  sugar  = new Sugar("4c- $1, 12c-$3, 20c- $5");
            Cups   cups   = new Cups("50- $1, 150- $3, 250- $5");
            Ice    ice    = new Ice("90- $.90, 210- $2.10, 390- $3.90");

            List <Item> items = new List <Item>();

            items.Add(Lemons);
            items.Add(Sugar);
            items.Add(Ice);
            items.Add(Cups);


            foreach (Item item in items)
            {
                Console.WriteLine("Cost: " + item.cost);;
            }
        }
Example #21
0
        //public double GetLemonPurchasePrice()
        //{
        //    Lemon lemon = new Lemon();
        //     ItemCost = lemon.GetLemonCost() * UserLemonQuantity;
        //    //Display cost
        //    return ItemCost;
        //}

        //public double PayForLemons(Player player, Wallet wallet)
        //{

        //    //Wallet PlayerWallet = player.GetPlayerWallet();
        //    wallet.CheckWallet(ItemCost);
        //    wallet.Money = wallet.Money - ItemCost;
        //    //PlayerWallet.BuyItem();
        //    return wallet.Money;
        //}



        public double GetCupQuantity(Player player)
        {
            Cups cups = new Cups();

            Console.WriteLine("How many cups would you like to buy? 1-100");
            string UserInput       = Console.ReadLine();
            int    UserCupQuantity = Int32.Parse(UserInput);

            ItemCost = cups.GetCupCost() * UserCupQuantity;
            if (ItemCost > player.CurrentMoney.Money)
            {
                Console.WriteLine("You do not have enough money");
                return(player.CurrentMoney.Money);
            }
            else
            {
                player.CurrentMoney.Money = player.CurrentMoney.Money - ItemCost;
                Console.WriteLine("You bought " + UserCupQuantity + " cups and now have $" + Math.Round(player.CurrentMoney.Money, 2));
                player.CurrentInventory.InventoryCups = UserCupQuantity + player.CurrentInventory.InventoryCups;
                Console.WriteLine("You now have " + player.CurrentInventory.InventoryCups + " in your inventory");
                return(player.CurrentMoney.Money);
            }
        }
Example #22
0
        public void PurchaseFromStore(Store store, Player player, Lemons lemons, IceCubes iceCubes, Sugar sugar, Cups cups)
        {
            string input               = "";
            string amountToPurchase    = "";
            int    amountToPurchaseInt = 0;

            while (input.ToLower() != "exit")
            {
                input = userInterface.GetStringInput("Type 'lemons' to buy lemons, 'ice' to buy ice cubes, 'sugar' to purchase cups of sugar, or 'cups' to purchase cups. Type 'exit' to finish purchasing");
                switch (input.ToLower())
                {
                case "lemons":
                    PurchaseLemons(store, player, lemons, amountToPurchase, amountToPurchaseInt);
                    break;

                case "ice":
                    PurchaseIce(store, player, iceCubes, amountToPurchase, amountToPurchaseInt);
                    break;

                case "sugar":

                    PurchaseSugar(store, player, sugar, amountToPurchase, amountToPurchaseInt);
                    break;

                case "cups":
                    PurchaseCups(store, player, cups, amountToPurchase, amountToPurchaseInt);
                    break;

                default:
                    break;
                }
            }
        }
Example #23
0
        //
        // UPDATE METHODS - UPDATE PURCHASES, PRICES, SPOILAGE
        //
        public void update()
        {
            // Update Spoilage of inventory
            this.lemonInventory.update();
            this.sugarInventory.update();
            // this.iceInventory.update(); // Ice has a variable spoilage that is not programmed in yet
            // this.cupInventory.update(); // Cups do not spoil


            //
            // Purchase new inventory based off the day's sales
            //
            int inventoryBumpForSales = 2; // For each lemon sold, but two more

            // Lemons
            for (int i = 0; i < lemonsSoldToday; i++)
            {
                for (int j = 0; j < inventoryBumpForSales; j++)
                {
                    Ingredient lemon = new Lemon();
                    lemonInventory.add(lemon);
                    cashOnHand -= lemonSalePrice / 2;
                }
            }
            // Sugar
            for (int i = 0; i < sugarSoldToday; i++)
            {
                for (int j = 0; j < inventoryBumpForSales; j++)
                {
                    Ingredient sugar = new Sugar();
                    sugarInventory.add(sugar);
                    cashOnHand -= sugarSalePrice / 2;
                }
            }
            // Ice
            for (int i = 0; i < iceSoldToday; i++)
            {
                for (int j = 0; j < inventoryBumpForSales; j++)
                {
                    Ingredient ice = new Ice();
                    iceInventory.add(ice);
                    cashOnHand -= iceSalePrice / 2;
                }
            }
            // Cup
            for (int i = 0; i < cupSoldToday; i++)
            {
                for (int j = 0; j < inventoryBumpForSales; j++)
                {
                    Ingredient cup = new Cups();
                    cupInventory.add(cup);
                    cashOnHand -= cupSalePrice / 2;
                }
            }



            //
            // Update Prices based off the day's sales.
            //
            // Lemons
            if (this.lemonsSoldToday == 0)
            {
                this.lemonSalePrice -= .01f;
            }
            else
            {
                this.lemonSalePrice += .01f * this.lemonsSoldToday;
            }
            // Sugar
            if (this.sugarSoldToday == 0)
            {
                this.sugarSalePrice -= .01f;
            }
            else
            {
                this.sugarSalePrice += .01f * this.sugarSoldToday;
            }
            // Ice
            if (this.iceSoldToday == 0)
            {
                this.iceSalePrice -= .01f;
            }
            else
            {
                this.iceSalePrice += .01f * this.iceSoldToday;
            }
            // Cups
            if (this.cupSoldToday == 0)
            {
                this.cupSalePrice -= .01f;
            }
            else
            {
                this.cupSalePrice += .01f * this.cupSoldToday;
            }

            //
            // Calculate Todays Fixed Operating Cost
            //
            float dailyHardCost = 50f;

            this.cashOnHand -= dailyHardCost;


            //
            // Reset Daily Sales Count
            //
            this.lemonsSoldToday = 0;
            this.sugarSoldToday  = 0;
            this.iceSoldToday    = 0;
            this.cupSoldToday    = 0;
        }
Example #24
0
        public Supplier()
        {
            // Generate Random Name
            NameGenerator nameGenerator = new NameGenerator();

            this.name = nameGenerator.GenRandomLastName();

            //
            // Generate Random Starting Inventory
            //
            int minStartingQuantity = 5;
            int maxStartingQuantity = 15;

            System.Threading.Thread.Sleep(100);
            Random random = new Random();
            // Lemons

            int generateQuantity = random.Next(minStartingQuantity, maxStartingQuantity);

            for (int i = 0; i < generateQuantity; i++)
            {
                lemonInventory.add(new Lemon());
            }
            // Sugar
            generateQuantity = random.Next(minStartingQuantity, maxStartingQuantity);
            for (int i = 0; i < generateQuantity; i++)
            {
                Ingredient lemon = new Lemon();
                this.lemonInventory.add(lemon);
            }
            // Sugar
            generateQuantity = random.Next(1, 15);
            for (int i = 0; i < generateQuantity; i++)
            {
                Ingredient sugar = new Sugar();
                sugarInventory.add(sugar);
            }
            // Ice
            generateQuantity = random.Next(minStartingQuantity, maxStartingQuantity);
            for (int i = 0; i < generateQuantity; i++)
            {
                Ingredient ice = new Ice();
                iceInventory.add(ice);
            }
            // Cups
            generateQuantity = random.Next(minStartingQuantity, maxStartingQuantity);
            for (int i = 0; i < generateQuantity; i++)
            {
                Ingredient cups = new Cups();
                cupInventory.add(cups);
            }


            // Generate Random Price List ??
            // STUB Hard Code STUB
            int basePrice   = 1;
            int minVariance = 10;
            int maxVariance = 100;

            this.lemonSalePrice = basePrice + (random.Next(minVariance, maxVariance) / 100f);
            this.sugarSalePrice = basePrice + (random.Next(minVariance, maxVariance) / 100f);
            this.iceSalePrice   = basePrice + (random.Next(minVariance, maxVariance) / 100f);
            this.cupSalePrice   = basePrice + (random.Next(minVariance, maxVariance) / 100f);

            // Generate Random Cash on Hand
            int minStartingCash = 600;
            int maxStartingCash = 1400;

            this.cashOnHand = random.Next(minStartingCash, maxStartingCash);
        }
Example #25
0
        public Supplier()
        {
            // Generate Random Name
            NameGenerator nameGenerator = new NameGenerator();
            this.name = nameGenerator.GenRandomLastName();

            //
            // Generate Random Starting Inventory
            //
            int minStartingQuantity = 5;
            int maxStartingQuantity = 15;
            System.Threading.Thread.Sleep(100);
            Random random = new Random();
            // Lemons

            int generateQuantity = random.Next(minStartingQuantity, maxStartingQuantity);
            for (int i = 0; i < generateQuantity; i++)
            {

                lemonInventory.add(new Lemon());
            }
            // Sugar
            generateQuantity = random.Next(minStartingQuantity, maxStartingQuantity);
            for (int i = 0; i < generateQuantity; i++)
            {
                Ingredient lemon = new Lemon();
                this.lemonInventory.add(lemon);
            }
            // Sugar
            generateQuantity = random.Next(1,15);
            for (int i = 0; i < generateQuantity; i++)
            {
                Ingredient sugar = new Sugar();
                sugarInventory.add(sugar);
            }
            // Ice
            generateQuantity = random.Next(minStartingQuantity, maxStartingQuantity);
            for (int i = 0; i < generateQuantity; i++)
            {
                Ingredient ice = new Ice();
                iceInventory.add(ice);
            }
            // Cups
            generateQuantity = random.Next(minStartingQuantity, maxStartingQuantity);
            for (int i = 0; i < generateQuantity; i++)
            {
                Ingredient cups = new Cups();
                cupInventory.add(cups);
            }

            // Generate Random Price List ??
            // STUB Hard Code STUB
            int basePrice = 1;
            int minVariance = 10;
            int maxVariance = 100;
            this.lemonSalePrice = basePrice + (random.Next(minVariance, maxVariance)/100f);
            this.sugarSalePrice = basePrice + (random.Next(minVariance, maxVariance)/100f);
            this.iceSalePrice = basePrice + (random.Next(minVariance, maxVariance)/100f);
            this.cupSalePrice = basePrice + (random.Next(minVariance, maxVariance)/100f);

            // Generate Random Cash on Hand
            int minStartingCash = 600;
            int maxStartingCash = 1400;
            this.cashOnHand = random.Next(minStartingCash, maxStartingCash);
        }
Example #26
0
        //
        // UPDATE METHODS - UPDATE PURCHASES, PRICES, SPOILAGE
        //
        public void update()
        {
            // Update Spoilage of inventory
            this.lemonInventory.update();
            this.sugarInventory.update();
            // this.iceInventory.update(); // Ice has a variable spoilage that is not programmed in yet
            // this.cupInventory.update(); // Cups do not spoil

            //
            // Purchase new inventory based off the day's sales
            //
            int inventoryBumpForSales = 2; // For each lemon sold, but two more
            // Lemons
            for (int i = 0; i < lemonsSoldToday; i++)
            {
                for (int j = 0; j < inventoryBumpForSales; j++)
                {
                    Ingredient lemon = new Lemon();
                    lemonInventory.add(lemon);
                    cashOnHand -= lemonSalePrice/2;

                }
            }
            // Sugar
            for (int i = 0; i < sugarSoldToday; i++)
            {
                for (int j = 0; j < inventoryBumpForSales; j++)
                {
                    Ingredient sugar = new Sugar();
                    sugarInventory.add(sugar);
                    cashOnHand -= sugarSalePrice / 2;
                }
            }
            // Ice
            for (int i = 0; i < iceSoldToday; i++)
            {
                for (int j = 0; j < inventoryBumpForSales; j++)
                {
                    Ingredient ice = new Ice();
                    iceInventory.add(ice);
                    cashOnHand -= iceSalePrice / 2;
                }
            }
            // Cup
            for (int i = 0; i < cupSoldToday; i++)
            {
                for (int j = 0; j < inventoryBumpForSales; j++)
                {
                    Ingredient cup = new Cups();
                    cupInventory.add(cup);
                    cashOnHand -= cupSalePrice / 2;
                }
            }

            //
            // Update Prices based off the day's sales.
            //
            // Lemons
            if (this.lemonsSoldToday == 0)
            {
                this.lemonSalePrice -= .01f;
            }
            else
            {
                this.lemonSalePrice += .01f * this.lemonsSoldToday;
            }
            // Sugar
            if (this.sugarSoldToday == 0)
            {
                this.sugarSalePrice -= .01f;
            }
            else
            {
                this.sugarSalePrice += .01f * this.sugarSoldToday;
            }
            // Ice
            if (this.iceSoldToday == 0)
            {
                this.iceSalePrice -= .01f;
            }
            else
            {
                this.iceSalePrice += .01f * this.iceSoldToday;
            }
            // Cups
            if (this.cupSoldToday == 0)
            {
                this.cupSalePrice -= .01f;
            }
            else
            {
                this.cupSalePrice += .01f * this.cupSoldToday;
            }

            //
            // Calculate Todays Fixed Operating Cost
            //
            float dailyHardCost = 50f;
            this.cashOnHand -= dailyHardCost;

            //
            // Reset Daily Sales Count
            //
            this.lemonsSoldToday = 0;
            this.sugarSoldToday = 0;
            this.iceSoldToday = 0;
            this.cupSoldToday = 0;
        }
Example #27
0
 public int AdjustCupsAmount(Store store, Cups cups, int amountToPurchaseInt, int itemsToAdd)
 {
     cups.currentStock += itemsToAdd;
     return(cups.currentStock);
 }
Example #28
0
        public void RunDay(Store store, Player player, int dayNumber, Lemons lemons, IceCubes iceCubes, Sugar sugar, Cups cups)
        {
            moneyInWalletAtStart = player.Money;

            weather.DetermineForecast();
            userInterface.DisplayBeginningOfDayInfo(weather.forecast, weather.highTemperatureForecast, dayNumber, player.Money);
            userInterface.ShowRecipe(lemonsPerPitcher, cupsSugarPerPitcher, iceCubesPerGlass, pricePerCup);
            ChangeRecipe();
            userInterface.ShowRecipe(lemonsPerPitcher, cupsSugarPerPitcher, iceCubesPerGlass, pricePerCup);
            PurchaseFromStore(store, player, lemons, iceCubes, sugar, cups);
            userInterface.DisplayInventory(cups.currentStock, lemons.currentStock, sugar.currentStock, iceCubes.currentStock);
            DetermineGlassesPerPitcher();
            DeterminePotentialCustomers();
            DetermineCupsSold();
            AddProfit(player);
            player.FindProfit(moneyInWalletAtStart);
            lemons.DecreaseInventory(cupsSold, pitcherLooper, lemonsPerPitcher);
            sugar.DecreaseInventory(cupsSold, pitcherLooper, cupsSugarPerPitcher);
            cups.DecreaseInventory(cupsSold);
            iceCubes.DecreaseInventory(cupsSold, iceCubesPerGlass);

            GetPopularity();
            userInterface.DisplayEndOfDayInfo(CheckForSoldOut(iceCubes.currentStock, lemons.currentStock, sugar.currentStock, cups.currentStock), weather.forecast, weather.highTemperatureForecast, dayNumber, player.Money, player.Profit, cupsSold, popularity);
        }