private void Start() { interactableName = ingredientName.ToString(); interactNotification = "Picked up " + ingredientName; interactStates = new List <GameState>(); interactStates.Add(GameState.IngredientSearch); }
private void SetName() { switch (GameManager.instance.language) { case Language.English: text.text = ingredientName.ToString(); break; case Language.Korean: switch (type) { case IngredientType1.meat: text.text = names_meat[x]; break; case IngredientType1.seafood: text.text = names_seafood[x]; break; case IngredientType1.vegetable: text.text = names_vegetable[x]; break; } break; } }
public Dictionary <string, int> AddNewIngredients(Dictionary <string, int> newIngredient) { CollectionIngredients collectionIngredients = new CollectionIngredients(); JsonIngredientRepository ingredientRepository = new JsonIngredientRepository(); Ingredients ingredients = new Ingredients(); collectionIngredients = ingredientRepository.Read(path); //GetLastIdIngredients() Id id = new Id(); int bufId = id.id + 1; int dictionaryId = 0, dictionaryValue = 0; var dishIngredients = new Dictionary <string, int>(); bool flag; foreach (var IngredientName in newIngredient.Keys) { // сравнение //не нашел, как сделать производительние( flag = true; for (int i = 0; i < collectionIngredients.ListIngredients.Count; i++) { if (collectionIngredients.ListIngredients[i].Name.ToString() == IngredientName.ToString()) { dictionaryId = collectionIngredients.ListIngredients[i].Id; dictionaryValue = newIngredient[IngredientName]; dishIngredients.Add(dictionaryId.ToString(), dictionaryValue); flag = false; } } if (flag == false) { continue; } else { ingredients.Name = IngredientName; ingredients.Id = bufId; collectionIngredients.ListIngredients.Add(ingredients); dictionaryId = bufId; dictionaryValue = newIngredient[IngredientName]; dishIngredients.Add(dictionaryId.ToString(), dictionaryValue); bufId++; } } ingredientRepository.Update(path, collectionIngredients); return(dishIngredients); }
public Genorator() { IngredientsFound = new Dictionary <IngredientName, Ingredient>(); for (int i = 0; i < Enum.GetValues(typeof(IngredientName)).Length; i++) { IngredientName t = (IngredientName)i; IngredientsFound.Add(t, new Ingredient() { Name = t.ToString() }); } }
public string[] returnRowDataGrid() { string[] rowdata = new string[5]; rowdata[0] = RecipeIngredientsID.ToString(); rowdata[1] = IngredientName.ToString(); rowdata[2] = Quantity.ToString(); rowdata[3] = UnitName.ToString(); try { if (string.IsNullOrEmpty(Comments)) { rowdata[4] = ""; } else { rowdata[4] = Comments.ToString(); } } catch { rowdata[4] = ""; } return(rowdata); }