internal static List <string> GetExtraMeals(string mealName) { var mealIngreadients = getMeal(mealName).Ingreadients; var spareMealsList = new List <string>(); var allMeals = DataStorage.GetSFSArray(dataKeys.meals.ToString()); foreach (var item in mealIngreadients) { List <string> spareIngradiants = GetChildIngreadients(item); foreach (var spareIngradiant in spareIngradiants) { for (int i = 0; i < allMeals.Count; i++) { var meal = new MealStruct((SFSObject)allMeals.GetSFSObject(i)); if (meal.name != mealName && meal.HaveIngreadient(spareIngradiant)) { spareMealsList.Add(meal.name); } } } } return(spareMealsList); }
private static List <string> getMealsHaveIngreadient(string ingreadientName) { List <string> mealsList = new List <string>(); var allMeals = DataStorage.GetSFSArray(dataKeys.meals.ToString()); for (int i = 0; i < allMeals.Count; i++) { var meal = new MealStruct((SFSObject)allMeals.GetSFSObject(i)); if (meal.HaveIngreadient(ingreadientName)) { mealsList.Add(meal.name); } } return(mealsList); }