private List <Recipe> DownloadRecipesOf(CocktailsList cocktails) { var recipes = new List <Recipe>(); foreach (var drinkInfo in cocktails.drinks) { var drink = DownloadRecipe(drinkInfo.idDrink); recipes.Add(drink); } return(recipes); }
internal void FindWithIngredients(List <string> ingredients) { CocktailsList cocktails = DownloadNamesOfCocktailsWith(ingredients[0]); List <Recipe> recipes = DownloadRecipesOf(cocktails); var coctailsSortedByMatchingIngredients = GetCoctailsSortedByMatchingIngredients(recipes, ingredients); Console.WriteLine("Pasujące drinki:"); foreach (var cocktail in coctailsSortedByMatchingIngredients) { Console.WriteLine(" * " + cocktail.GetNameAndIngredietnsString()); } }