Esempio n. 1
0
 private static void ShowCertainRecipeFromList(Cookbook cookbook, List <Recipe> recipes)
 {
     ShowRecipeNames(recipes);
     if (recipes.Count > 0)
     {
         int    recipeNumber = AuxiliaryMethod.LoadNumberInRange("\nKterý recept chcete zobrazit?", recipes.Count);
         Recipe recipe       = cookbook.FindRecipeByName(cookbook.Recipes[recipeNumber - 1].Name);
         if (recipe != null)
         {
             RecipeConsoleUtility.ViewRecipe(recipe);
         }
     }
     else
     {
         Console.WriteLine("Nejsou žádné recepty k zobrazení.");
     }
 }
Esempio n. 2
0
        public static void ShowRandomMenu(Cookbook cookbook)
        {
            Dictionary <Category, Recipe> randomMenu = cookbook.GenerateRandomMenu();

            foreach (Category i in Enum.GetValues(typeof(Category)))
            {
                Console.WriteLine($"{ i }:");

                if (randomMenu.ContainsKey(i))
                {
                    RecipeConsoleUtility.ViewRecipe(randomMenu[i]);
                }
                else
                {
                    Console.WriteLine("Recept s touto kategorií není k dispozici.\n");
                }
            }
            AddIngredientsToShoppingList(randomMenu, cookbook);
        }
Esempio n. 3
0
 public static void ViewRecipes(Cookbook cookbook)
 {
     {
         cookbook.Recipes.ForEach(x => RecipeConsoleUtility.ViewRecipe(x));
     }
 }