private void getCookingStep(string food, ref FoodData destFood) { List <string> ingreidents = new List <string>(); FoodData fd = GetFood(food); MyDebug.Assert(fd != null, "Food not found: " + food); foreach (string key in fd.ingredients) { FoodData keyFood = GetFood(key); if (keyFood != null && !IngredientDataManager.GetInstance().IsIngredientKey(key)) { getCookingStep(key, ref destFood); } else { System.Diagnostics.Debug.Assert(_ingMgr.GetIngredient(key) != null, "Ingredient not found for: " + key); destFood.ingredient_set.Add(key); } ingreidents.Add(key); } CookingStep cs = new CookingStep(); cs.canIgnore = false; cs.id = fd.id; cs.food = fd.key; cs.price = fd.price; cs.cookwareType = fd.cookware_type; cs.cookTime = fd.cook_time; cs.ingredients = ingreidents; destFood.cooking_step_list.Add(cs); }
public static IngredientDataManager GetInstance() { if (_instance == null) { _instance = new IngredientDataManager(); } return(_instance); }