예제 #1
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);
        }
예제 #2
0
        public double NumberOfSugarPurchased(int NumberOfSugarNeeded)
        {
            Sugar sugar = new Sugar();

            checkOutSugar = sugar.GetCost() * NumberOfSugarNeeded;
            return(checkOutSugar);
        }
예제 #3
0
 public Inventory()
 {
     cups   = new Cup();
     lemons = new Lemon();
     sugar  = new Sugar();
     ice    = new Ice();
 }
예제 #4
0
        public void BuySugar()
        {
            Console.WriteLine("How many cups of sugar are you buying?");
            amountOfSugar = int.Parse(Console.ReadLine());

            if (player.wallet.Money > 0.69)
            {
                if (amountOfSugar == 8)
                {
                    player.wallet.Money -= 0.69;
                }
                else if (amountOfSugar == 20)
                {
                    player.wallet.Money -= 1.52;
                }
                else
                {
                    player.wallet.Money -= 3.30;
                }


                for (int i = 0; i < amountOfSugar; i++)
                {
                    Sugar sugar = new Sugar();
                    player.inventory.cupsOfSugar.Add(sugar);
                }
            }
            else
            {
                Console.WriteLine("You do not have enough money to buy sugar!");
            }
        }
예제 #5
0
 public Store()
 {
     lemons    = new Lemons();
     paper_Cup = new Paper_Cup();
     sugar     = new Sugar();
     ice_Cubes = new Ice_Cubes();
 }
예제 #6
0
 public Inventory()
 {
     cup      = new Cup();
     lemon    = new Lemon();
     sugar    = new Sugar();
     iceCubes = new IceCube();
 }
예제 #7
0
 public Expenses()
 {
     ice    = new Ice();
     lemons = new Lemons();
     sugar  = new Sugar();
     cup    = new Cup();
 }
예제 #8
0
        public List <Sugar> SellSugar(int itemsBeingSold, Bank bank)
        {
            List <Sugar> newSugar = new List <Sugar>();
            Sugar        sugar    = new Sugar();

            if (itemsBeingSold != 20)
            {
                for (int i = 0; i < itemsBeingSold; i++)
                {
                    if (bank.SubtractMoney(sugar.GetCost()))
                    {
                        newSugar.Add(new Sugar());
                    }
                }
            }
            else
            if (bank.SubtractMoney(sugar.GetBulkCost()))
            {
                for (int i = 0; i < itemsBeingSold; i++)
                {
                    newSugar.Add(new Sugar());
                }
            }
            return(newSugar);
        }
예제 #9
0
 public Store()
 {
     lemons = new Lemon();
     ice    = new Ice();
     sugars = new Sugar();
     cups   = new Cup();
 }
        public void BuySugar()
        {
            int buySugarAmount;

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

            int.TryParse(sugarAmountInput, out buySugarAmount);
            if (wallet.amountOfMoney - (costOfSugar * buySugarAmount) > costOfSugar)
            {
                inventory.inventorySugarCount += buySugarAmount;
                wallet.amountOfMoney           = wallet.amountOfMoney - (costOfSugar * buySugarAmount);
                Console.WriteLine("You bought {0} cups of Sugar.", buySugarAmount);
            }
            else if (wallet.amountOfMoney < (costOfSugar * buySugarAmount))
            {
                Console.WriteLine("Insufficient Funds");
                Console.ReadLine();
                BuySugar();
            }
            for (int k = 0; k < buySugarAmount; k++)
            {
                Sugar sugar = new Sugar();
                inventory.inventorySugar.Add(sugar);
            }
        }
예제 #11
0
 public void AddInitialInventory()
 {
     lemons   = new Lemons();
     sugar    = new Sugar();
     iceCubes = new IceCubes();
     cups     = new Cups();
 }
예제 #12
0
        public double amountOfSugarPurchased(int sugarNeededToBuy)
        {
            Sugar sugar = new Sugar();

            getSugar = sugar.pullCost() * sugarNeededToBuy;
            return(getSugar);
        }
예제 #13
0
 public void AddSugarToInventory(int quantity)
 {
     for (int i = 0; i < quantity; i++)
     {
         Sugar sugar = new Sugar();
         sugar.Add(sugar);
     }
 }
예제 #14
0
 public Store(Player player)
 {
     this.player = player;
     lemons      = new Lemons();
     sugar       = new Sugar();
     ice         = new IceCubes();
     cups        = new Cups();
 }
예제 #15
0
 public void AddSugarToInventory(int Number)
 {
     for (int i = 0; i < Number; i++)
     {
         Sugar sugar = new Sugar();
         amountOfSugarInPlayersInventoy.Add(sugar);
     }
 }
예제 #16
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;
 }
예제 #17
0
 public void RemoveSugar(double Number)
 {
     for (double i = 0; i < Number; i++)
     {
         Sugar sugar = new Sugar();
         SugarList.RemoveAt(0);
     }
 }
예제 #18
0
 public void AddSugar(double Number)
 {
     for (double i = 0; i < Number; i++)
     {
         Sugar sugar = new Sugar();
         SugarList.Add(sugar);
     }
 }
예제 #19
0
 public void AddingSugar(Player player)
 {
     for (int i = 0; i < player.numberOfItemsBought; i++)
     {
         Sugar Sugar = new Sugar();
         storingSugar.Add(1);
     }
 }
예제 #20
0
 public void GenerateSugar(int numberOfItem)
 {
     for (int i = 0; i < numberOfItem; i++)
     {
         Sugar sugar = new Sugar();
         inventory.sugarcubes.Add(sugar);
     }
 }
예제 #21
0
 public void RemoveSugarFromInventory(double Number)
 {
     for (double i = 0; i < Number; i++)
     {
         Sugar sugar = new Sugar();
         amountOfSugarInPlayersInventoy.RemoveAt(0);
     }
 }
예제 #22
0
 public void AddSugars(int amount)
 {
     for (int i = 0; i < amount; i++)
     {
         Sugar addSugar = new Sugar();
         AddSugar(addSugar);
     }
 }
예제 #23
0
 // Constructors
 public Store()
 {
     cups   = new Cups();
     lemons = new Lemons();
     sugar  = new Sugar();
     ice    = new Ice();
     Console.WriteLine("Initialized Store.");
 }
예제 #24
0
 public void AddSugarToInventory(int amountOfSugar)
 {
     for (int i = 0; i < amountOfSugar; i++)
     {
         Sugar sugar = new Sugar();
         player.inventory.sugar.Add(sugar);
     }
 }
예제 #25
0
 public void AddSugar(int AmountOfSugarNeeded)
 {
     for (int i = 0; i < AmountOfSugarNeeded; i++)
     {
         Sugar sugar = new Sugar();
         this.sugar.Add(sugar);
     }
     Console.WriteLine("You currently have {0} cups of sugar.", sugar.Count);
 }
예제 #26
0
 public void BuySugarMath(string amountToBuy)
 {
     for (int i = 0; i < int.Parse(amountToBuy); i++)
     {
         Sugar sugar = new Sugar();
         sugarInventory.Add(sugar);
     }
     Console.WriteLine("You now have " + sugarInventory.Count + " cups of sugar");
 }
예제 #27
0
 public void SubmitSugar(int amountOFSugarNeeded)
 {
     for (int i = 0; i < amountOFSugarNeeded; i++)
     {
         Sugar sugar = new Sugar();
         this.sugar.Add(sugar);
     }
     Console.WriteLine("You are buying {0} cups fo Sugar.", sugar.Count);
 }
예제 #28
0
 public void AddSugar(int NumberOfSugarNeeded)
 {
     for (int i = 0; i < NumberOfSugarNeeded; i++)
     {
         Sugar sugar = new Sugar();
         this.sugar.Add(sugar);
     }
     Console.WriteLine("You just bought {0} cups of Sugar.\n\n", sugar.Count);
 }
예제 #29
0
 //constructor
 public Store()
 {
     multiplier = 0;
     storeInput = null;
     lemon      = new Lemon();
     sugar      = new Sugar();
     iceCube    = new IceCube();
     cup        = new Cup();
 }
예제 #30
0
 // Constructors
 public Inventory()
 {
     ice               = new Ice();
     lemon             = new Lemon();
     sugar             = new Sugar();
     cup               = new Cup();
     beginningMoney    = 25.00;
     availableMoney    = beginningMoney;
     beginningDayMoney = availableMoney;
 }
예제 #31
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);
        }
예제 #32
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;
        }