Esempio n. 1
0
        public List <Ice> SellIce(int itemsBeingSold, Bank bank)
        {
            List <Ice> newIce = new List <Ice>();
            Ice        ice    = new Ice();

            if (itemsBeingSold != 250)
            {
                for (int i = 0; i < itemsBeingSold; i++)
                {
                    if (bank.SubtractMoney(ice.GetCost()))
                    {
                        newIce.Add(new Ice());
                    }
                }
            }
            else
            if (bank.SubtractMoney(ice.GetBulkCost()))
            {
                for (int i = 0; i < itemsBeingSold; i++)
                {
                    newIce.Add(new Ice());
                }
            }
            return(newIce);
        }
        public void BuyIce()
        {
            int buyIceAmount;

            Console.WriteLine("\nHow many cups of ice would you like to buy?");
            string iceAmountInput = Console.ReadLine();

            int.TryParse(iceAmountInput, out buyIceAmount);
            if (wallet.amountOfMoney - (costOfIce * buyIceAmount) > costOfIce)
            {
                inventory.inventoryIceCount += buyIceAmount;
                wallet.amountOfMoney         = wallet.amountOfMoney - (costOfIce * buyIceAmount);
                Console.WriteLine("You bought {0} cups of ice.", buyIceAmount);
            }
            else if (wallet.amountOfMoney < (costOfIce * buyIceAmount))
            {
                Console.WriteLine("Insufficient Funds");
                Console.ReadLine();
                BuyIce();
            }
            for (int j = 0; j < buyIceAmount; j++)
            {
                Ice ice = new Ice();
                inventory.inventoryIce.Add(ice);
            }
        }
Esempio n. 3
0
        public double NumberOfIceCubesPurchased(int NumberOfIceCubesNeeded)
        {
            Ice ice = new Ice();

            checkOutIceCubes = ice.GetCost() * NumberOfIceCubesNeeded;
            return(checkOutIceCubes);
        }
Esempio n. 4
0
        public Inventory()
        {
            itemList    = new List <List <Item> >();
            itemNames   = new List <string>();
            listOfItems = new List <Item>();
            cupList     = new List <Cup>().Cast <Item>().ToList();
            lemonList   = new List <Lemon>().Cast <Item>().ToList();
            sugarList   = new List <Sugar>().Cast <Item>().ToList();
            iceList     = new List <Ice>().Cast <Item>().ToList();
            cup         = new Cup();
            lemon       = new Lemon();
            sugar       = new Sugar();
            ice         = new Ice();
            dailyProfit = 0.00;
            //overallProfit = 0.00;
            itemsOutOfStock = false;

            itemList.Add(cupList);
            itemList.Add(lemonList);
            itemList.Add(sugarList);
            itemList.Add(iceList);

            itemNames.Add("plastic cups");
            itemNames.Add("lemons");
            itemNames.Add("cups of sugar");
            itemNames.Add("ice cubes");

            listOfItems.Add(cup);
            listOfItems.Add(lemon);
            listOfItems.Add(sugar);
            listOfItems.Add(ice);
        }
Esempio n. 5
0
 public Expenses()
 {
     ice    = new Ice();
     lemons = new Lemons();
     sugar  = new Sugar();
     cup    = new Cup();
 }
Esempio n. 6
0
 public Inventory()
 {
     cups   = new Cup();
     lemons = new Lemon();
     sugar  = new Sugar();
     ice    = new Ice();
 }
Esempio n. 7
0
 public Store()
 {
     lemons = new Lemon();
     ice    = new Ice();
     sugars = new Sugar();
     cups   = new Cup();
 }
Esempio n. 8
0
 public void RemoveIce(double Number)
 {
     for (double i = 0; i < Number; i++)
     {
         Ice ice = new Ice();
         IceList.RemoveAt(0);
     }
 }
Esempio n. 9
0
 public void AddIce(double Number)
 {
     for (double i = 0; i < Number; i++)
     {
         Ice ice = new Ice();
         IceList.Add(ice);
     }
 }
Esempio n. 10
0
 public void GenerateIce(int numberOfItem)
 {
     for (int i = 0; i < numberOfItem; i++)
     {
         Ice ice = new Ice();
         inventory.icecubes.Add(ice);
     }
 }
Esempio n. 11
0
 public void AddIceToInventory(int amountOfIce)
 {
     for (int i = 0; i < amountOfIce; i++)
     {
         Ice ice = new Ice();
         player.inventory.ice.Add(ice);
     }
 }
Esempio n. 12
0
 // Constructors
 public Store()
 {
     cups   = new Cups();
     lemons = new Lemons();
     sugar  = new Sugar();
     ice    = new Ice();
     Console.WriteLine("Initialized Store.");
 }
Esempio n. 13
0
 public void AddIces(int amount)
 {
     for (int i = 0; i < amount; i++)
     {
         Ice addIce = new Ice();
         AddIce(addIce);
     }
 }
Esempio n. 14
0
 public void RemoveIceFromInventory(double Number)
 {
     for (double i = 0; i < Number; i++)
     {
         Ice ice = new Ice();
         amountOfIceInPlayersInventoy.RemoveAt(0);
     }
 }
Esempio n. 15
0
 public void AddIceToInventory(int quantity)
 {
     for (int i = 0; i < quantity; i++)
     {
         Ice ice = new Ice();
         ice.Add(ice);
     }
 }
Esempio n. 16
0
 public void AddIceToInventory(int Number)
 {
     for (int i = 0; i < Number; i++)
     {
         Ice Ice = new Ice();
         amountOfIceInPlayersInventoy.Add(Ice);
     }
 }
Esempio n. 17
0
 public void AddIce(int AmountOfIceNeeded)
 {
     for (int i = 0; i < AmountOfIceNeeded; i++)
     {
         Ice ice = new Ice();
         this.ice.Add(ice);
     }
     Console.WriteLine("You currently have {0} cups.", ice.Count);
 }
Esempio n. 18
0
 public void AddIce(int NumberOfIceCubesNeeded)
 {
     for (int i = 0; i < NumberOfIceCubesNeeded; i++)
     {
         Ice ice = new Ice();
         this.ice.Add(ice);
     }
     Console.WriteLine("You currently have {0} ice cubes.\n\n", ice.Count);
 }
 public static void DisplayPurchasePrices(Cup cup, Lemon lemon, Sugar sugar, Ice ice)
 {
     Console.WriteLine();
     Console.WriteLine("Cost to buy:");
     Console.WriteLine($"Cup: ${cup.Price}");
     Console.WriteLine($"Lemon: ${lemon.Price}");
     Console.WriteLine($"Sugar: ${sugar.Price}");
     Console.WriteLine($"Ice: ${ice.Price}");
     Console.WriteLine();
 }
Esempio n. 20
0
 // Constructors
 public Inventory()
 {
     ice               = new Ice();
     lemon             = new Lemon();
     sugar             = new Sugar();
     cup               = new Cup();
     beginningMoney    = 25.00;
     availableMoney    = beginningMoney;
     beginningDayMoney = availableMoney;
 }
Esempio n. 21
0
        public void BuyIceMath(string amountToBuy)
        {
            for (int i = 0; i < int.Parse(amountToBuy); i++)
            {
                Ice ice = new Ice();
                iceInventory.Add(ice);
            }

            Console.WriteLine("You now have " + iceInventory.Count + " cups of ice");
        }
Esempio n. 22
0
 public Player()
 {
     
     
     ice = new Ice();
     cash = new Cash();
     recipe = new Recipe();
     expenses = new Expenses();
     sales = new Sales();
     
 }
Esempio n. 23
0
        public void AddIce(int iceQty, Wallet wallet)
        {
            double price = 0;

            for (int i = 1; i <= iceQty; i++)
            {
                Ice ice = new Ice();
                inventory.icecubes.Add(ice);
                price += ice.itemPrice;
            }
            CheckWallet(price, wallet);
        }
Esempio n. 24
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;
        }
Esempio n. 25
0
        //have prices
        public void GenerateIcePrice()
        {
            ice = new Ice();
            int result = MainMenu.RollDie(0, 10);

            if (result >= 5)
            {
                ice.price = 0.10;
            }
            else
            {
                ice.price = 0.05;
            }
        }
Esempio n. 26
0
 public void SellIce(Player player, int amountOfIce)
 {
     if (player.wallet.cash >= Ice.price * amountOfIce)
     {
         for (int i = 0; i < amountOfIce; i++)
         {
             Ice ice = new Ice();
             player.inventory.ice.Add(ice);
             player.wallet.cash -= Ice.price;
         }
     }
     Console.WriteLine($"You now have{player.inventory.ice.Count}  bags of ice, and your wallet balance is ${player.wallet.cash}");
     Console.WriteLine();
 }
Esempio n. 27
0
        public void SellIce()
        {
            Console.WriteLine("How much ice would you like to buy?");

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

            for (i = 0; i < boughtIce; i++)
            {
                Ice ice = new Ice();
            }
            Player.inventory.ice.Add(ice);

            Player.wallet.cash -= (boughtIce * Player.inventory.ice[1].price);
        }
Esempio n. 28
0
        public void BuyIce(Store store)
        {
            Console.WriteLine("How much ice do you want: ");
            int iceAmount = Convert.ToInt32(Console.ReadLine());

            capital = capital - (iceAmount * store.icePrice);
            Console.WriteLine("You have " + capital);

            for (int i = 0; i < iceAmount; i++)
            {
                Ice ice = new Ice();
                inventory.iceList.Add(ice);
            }
            Console.WriteLine("Your inventory now has " + inventory.iceList.Count + "ice");
        }
Esempio n. 29
0
        public void BuyIce()
        {
            int numberOfIce = NumberOfIceNeeded();
            Ice ice         = new Ice();

            enoughMoney = player.CheckIfEnoughMoney(numberOfIce, ice.IceCost);
            if (enoughMoney == true)
            {
                player.GenerateIce(numberOfIce);
                PurchaseIce         = (numberOfIce) * ice.IceCost;
                player.wallet.money = player.wallet.money - PurchaseIce;
            }
            else
            {
                numberOfIce = NumberOfIceNeeded();
            }
            player.DisplayInventory();
            PurchaseInventory();
        }
Esempio n. 30
0
        public void BuyIce(Purse purse)
        {
            Ice tempIce = new Ice();

            ShowInventory(purse.playerMoney);
            Console.WriteLine("\nHow much {1} would you like to buy at {0:0.00} Each?", tempIce.iceCost, Ice.itemName);
            string items           = Console.ReadLine();
            double itemsToPurchase = CheckForNumber(items);

            if (purse.CheckOverdraw(itemsToPurchase, tempIce.iceCost))
            {
                for (int i = 0; i < itemsToPurchase; i++)
                {
                    Ice newIce = new Ice();
                    playerIce.Add(newIce);
                }
                purse.WithdrawMoney(itemsToPurchase, tempIce.iceCost, Ice.itemName);
            }
            ChooseItemToPurchase(purse);
        }
Esempio n. 31
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;
        }
Esempio n. 32
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);
        }