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); }