Exemple #1
0
 /// <summary>
 /// function to add recipe ingredient to the dictionary.
 /// </summary>
 /// <param name="ingredientName"></param>
 /// <param name="weight"></param>
 public void AddRecipeIngredient(string ingredientName, double weight)
 {
     if (this.availableIngredients.ContainsKey(ingredientName))
     {
         Ingredient newIngredient = IngredientFactory.Create(ingredientName, weight);
         this.recipeIngredients.Add(ingredientName, newIngredient);
     }
     else
     {
         throw new NotSupportedException("Ingredient not available in containers.");
     }
 }
Exemple #2
0
 /// <summary>
 /// Function to label containers.
 /// </summary>
 /// <param name="containerName"> name of label.</param>
 public void LabelContainer(string containerName)
 {
     this.containers.Add(containerName, IngredientFactory.Create(containerName, 200));
 }