// Member methods // Method referenced from Store(); accepts type of item and quantity and adds quantity of item to the corresponding list public void AddToInventory(string item, int amount) { for (int i = 0; i < amount; i++) { switch (item) { case "lemons": Lemon lemon = new Lemon(); lemons.Add(lemon); break; case "sugar cubes": SugarCube sugarCube = new SugarCube(); sugarCubes.Add(sugarCube); break; case "ice cubes": IceCube iceCube = new IceCube(); iceCubes.Add(iceCube); break; case "cups": Cup cup = new Cup(); cups.Add(cup); break; } } }
public Inventory() { cup = new Cup(); lemon = new Lemon(); sugar = new Sugar(); iceCubes = new IceCube(); }
public Store() { lemons = new Lemon(); ice = new Ice(); sugars = new Sugar(); cups = new Cup(); }
//member methods (Can Do) public void BuyCups() { Console.WriteLine("How many cups are you buying?"); cupAmount = int.Parse(Console.ReadLine()); if (player.wallet.Money > 0.85) { if (cupAmount == 25) { player.wallet.Money -= 0.85; } else if (cupAmount == 50) { player.wallet.Money -= 1.73; } else { player.wallet.Money -= 2.96; } //do an if statement checking money in account, if it has more than the highest amount, then buy the item, otherwise don't for (int i = 0; i < cupAmount; i++) { Cup cup = new Cup(); player.inventory.cups.Add(cup); } } else { Console.WriteLine("You do not have enough money to buy the cups!"); } }
public double NumberOfCupsPurchased(int NumberOfCupsNeeded) { Cup cup = new Cup(); checkOutCups = cup.GetCost() * NumberOfCupsNeeded; return(checkOutCups); }
public Inventory() { cups = new Cup(); lemons = new Lemon(); sugar = new Sugar(); ice = new Ice(); }
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); }
public Expenses() { ice = new Ice(); lemons = new Lemons(); sugar = new Sugar(); cup = new Cup(); }
public void RemoveCupFromInventory(double Number) { for (double i = 0; i < Number; i++) { Cup cup = new Cup(); amountOfCupsInPlayersInventoy.RemoveAt(0); } }
public void AddCupToInventory(int Number) { for (int i = 0; i < Number; i++) { Cup cup = new Cup(); amountOfCupsInPlayersInventoy.Add(cup); } }
public void AddCupsToInventory(int numberOfCups) { for (int i = 0; i < numberOfCups; i++) { Cup cup = new Cup(); cups.Add(cup); } }
public void AddCups(int amount) { for (int i = 0; i < amount; i++) { Cup addCup = new Cup(); AddCup(addCup); } }
public void AddCups(int userInput) { for (int i = 0; i < userInput; i++) { Cup cup = new Cup(); cups.Add(cup); } }
//public void CurrentInventory() //{ // //string checkInput; // Console.WriteLine($"Inventory: Cups: {numberOfCup} Ice: {numberOfIce} Sugar: {numberOfSugar} Lemon: {numberOfLemon}"); // // minimum inventory to start game // if (numberOfCup < 15 && numberOfIce < 2 && numberOfSugar < 2 && numberOfLemon < 2) // { // Console.WriteLine("You do not have enough to make 1 pitcher of lemonade. Let's go shopping now."); // //System.Threading.Thread.Sleep(2000); // } // Console.WriteLine("Ok, you have enough for 1 pitcher now, you can buy more items or begin?"); //Console.WriteLine("Type 'Yes' to visit store or 'No' to exit game"); //checkInput = Console.ReadLine(); //if (checkInput[0] == 'n' || checkInput[0] == 'N') //{ // Environment.Exit(0); //} //else if (checkInput[0] == 'y' || checkInput[0] == 'Y') //{ //} //else //{ // Console.WriteLine(checkInput); //} //} public void AddCupToInventory(int quantity) { for (int i = 0; i < quantity; i++) { Cup cup = new Cup(); cup.Add(cup); } }
//constructor public Store() { multiplier = 0; storeInput = null; lemon = new Lemon(); sugar = new Sugar(); iceCube = new IceCube(); cup = new Cup(); }
public void AddCups(int NumberOfCupsNeeded) { for (int i = 0; i < NumberOfCupsNeeded; i++) { Cup cup = new Cup(); cups.Add(cup); } Console.WriteLine("You currently have {0} cups.\n\n", cups.Count); }
public void AddCups(int AmountOfCupsNeeded) { for (int i = 0; i < AmountOfCupsNeeded; i++) { Cup cups = new Cup(); this.cups.Add(cups); } Console.WriteLine("You currently have {0} cups.", cups.Count); }
public void AddCupsToInventory(int numberOfCups) { for (int i = 0; i < numberOfCups; i++) { Cup cup = new Cup(); cups.Add(cup); } Console.WriteLine("You currently have {0} SugarCube.\n\n", cups.Count); }
// Constructors public Inventory() { ice = new Ice(); lemon = new Lemon(); sugar = new Sugar(); cup = new Cup(); beginningMoney = 25.00; availableMoney = beginningMoney; beginningDayMoney = availableMoney; }
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(); }
public Inventory() { cup = new Cup(); sugar = new SugarCube(); lemon = new Lemon(); ice = new IceCube(); cups = new List <Cup>(); lemons = new List <Lemon>(); sugarCubes = new List <SugarCube>(); iceCubes = new List <IceCube>(); }
public void AddCups(int cupQty, Wallet wallet) { double price = 0; for (int i = 1; i <= cupQty; i++) { Cup cup = new Cup(); inventory.cups.Add(cup); price += cup.itemPrice; } CheckWallet(price, wallet); }
public static Item PurchaseItems() { Item choosenitem = null; do { Console.WriteLine("Enter the item you like to purchase: Lemon, Sugar, Ice Cube, Cup....Enter Start to Skip"); string itemInput = Console.ReadLine(); switch (itemInput) { case "Lemon": Console.WriteLine("How many? .20$ each"); choosenitem = new Lemon(0); break; case "Sugar": Console.WriteLine("How much? .12$ each"); choosenitem = new SugarCube(0); break; case "Ice Cube": Console.WriteLine("How many? 1.00$ for 10"); choosenitem = new IceCube(0); break; case "Cup": Console.WriteLine("How many? .10$"); choosenitem = new Cup(0); break; case "Start": choosenitem = new Lemon(0); choosenitem.name = "Start"; break; default: { Console.WriteLine("Please Try again"); choosenitem = null; break; } } } while (choosenitem == null); //if (choosenitem == null)//use function, will not return unless something is choosen //{ // PurchaseItems(); //} //itemInput = null; return(choosenitem); }
public List <Item> AddItem(int quantity, string type) { List <Item> list = new List <Item>(); switch (type) { case "cups": for (int i = 0; i < quantity; i++) { Cup cup = new Cup(); list.Add(cup); } return(list); case "ice cubes": for (int i = 0; i < quantity; i++) { IceCube iceCube = new IceCube(); list.Add(iceCube); } return(list); case "sugar units": for (int i = 0; i < quantity; i++) { SugarUnit sugarUnit = new SugarUnit(); list.Add(sugarUnit); } return(list); case "lemons": for (int i = 0; i < quantity; i++) { Lemon lemon = new Lemon(); list.Add(lemon); } return(list); default: return(list); } }
public void DecrementInventory(Item itemUsedInRecipe, int amountToDecrement) { string itemName = itemUsedInRecipe.name; switch (itemName) { case "lemon": for (int i = 0; i < amountToDecrement; i++) { Lemon lemon = new Lemon(); lemons.Remove(lemon); } break; case "cup of sugar": for (int i = 0; i < amountToDecrement; i++) { CupOfSugar sugar = new CupOfSugar(); cupsOfSugar.Remove(sugar); } break; case "pack of ice cubes": for (int i = 0; i < amountToDecrement; i++) { IceCube ice = new IceCube(); iceCubes.Remove(ice); } break; case "cup": for (int i = 0; i < amountToDecrement; i++) { Cup cup = new Cup(); cups.Remove(cup); } break; default: break; } }
public void IncrementInventory(Item purchaseItem, int amountToIncrement) { string itemName = purchaseItem.name; switch (itemName) { case "lemon": for (int i = 0; i < amountToIncrement; i++) { Lemon lemon = new Lemon(); lemons.Add(lemon); } break; case "cup of sugar": for (int i = 0; i < amountToIncrement; i++) { CupOfSugar sugar = new CupOfSugar(); cupsOfSugar.Add(sugar); } break; case "pack of ice cubes": for (int i = 0; i < amountToIncrement; i++) { IceCube ice = new IceCube(); iceCubes.Add(ice); } break; case "cup": for (int i = 0; i < amountToIncrement; i++) { Cup cup = new Cup(); cups.Add(cup); } break; default: break; } }
public void BuyCups(Purse purse) { Cup tempCup = new Cup(); ShowInventory(purse.playerMoney); Console.WriteLine("\nHow many {1}s would you like to buy at {0:0.00} Each?", tempCup.cupCost, Cup.itemName); string items = Console.ReadLine(); double itemsToPurchase = CheckForNumber(items); if (purse.CheckOverdraw(itemsToPurchase, tempCup.cupCost)) { for (int i = 0; i < itemsToPurchase; i++) { Cup newCup = new Cup(); playerCups.Add(newCup); } purse.WithdrawMoney(itemsToPurchase, tempCup.cupCost, Cup.itemName); } ChooseItemToPurchase(purse); }
public void AddItemsToInventory(int quantity, string item) { switch (item) { case "cups": for (int i = 0; i < quantity; i++) { Cup cup = new Cup(); cups.Add(cup); } break; case "lemons": for (int i = 0; i < quantity; i++) { Lemon lemon = new Lemon(); lemons.Add(lemon); } break; case "sugar": for (int i = 0; i < quantity; i++) { SugarCube sug = new SugarCube(); sugarCubes.Add(sug); } break; case "ice": for (int i = 0; i < quantity; i++) { IceCube ice = new IceCube(); iceCubes.Add(ice); } break; } }
public void AddCup(Cup cup) { cupInventory.Add(cup); }
//single responsibility - adds a single new cup object to a list of cups public void AddCups() { Cup cup = new Cup(); cupsInInventory.Add(cup); }