public void UpdateInv(Cupcake lookupCupcake, int qnty) { double[] cupcakeRequirements = lookupCupcake.GetIngredients(); int i = 0; foreach (var item in StoreInv) { StoreInv[i] -= (double)(cupcakeRequirements[i] * qnty); i++; } }
public bool CheckInv(Cupcake lookupCupcake, int qnty) { double[] cupcakeRequirements = lookupCupcake.GetIngredients(); int i = 0; foreach (var item in StoreInv) { if (StoreInv[i] < (double)(cupcakeRequirements[i] * qnty)) { return(false); } i++; } return(true); }
public static Cupcake GetCupcake() { ILogger logger = LogManager.GetCurrentClassLogger(); ConsoleDisplay.CupcakeList(); Console.WriteLine("Please enter the name of a cupcake as it appears on the list:"); var input = Console.ReadLine(); try { if () { CupcakeNum cupcakeType = (CupcakeNum)Enum.Parse(typeof(CupcakeNum), input); } Cupcake lookupCupcake = Cupcake.FindCupcake(cupcakeType); return(cupcakeType, lookupCupcake); } catch (SystemException ex) { logger.Error(ex); return(null); } }