public void Prime(BaseIngredient ingredient) { this.ingredient = ingredient; if (ingredient == null) { if (textName != null) { textName.text = ""; } if (sprite != null) { sprite.sprite = null; } return; } if (textName != null) { textName.text = ingredient.displayName; } if (sprite != null) { sprite.sprite = ingredient.sprite; } }
public void Add(BaseIngredient ingredient) { if (ingredient == null) { return; } ingredients.Add(ingredient); if (onChanged != null) { onChanged.Invoke(this); } }
public bool IsShown(BaseIngredient ingredient) { if (leftSlot == ingredient) { return(true); } if (rightSlot == ingredient) { return(true); } return(false); }
void HandleonClick(BaseIngredient ingredient) { if (combo.IsShown(ingredient)) { combo.UnShow(ingredient); GlobalParty.ingredientInventory.Add(ingredient); GlobalParty.chocolateInventory.Add(ingredient); return; } if (combo.ShowImage(ingredient)) { GlobalParty.ingredientInventory.Remove(ingredient); GlobalParty.chocolateInventory.Remove(ingredient); } }
public void Remove(BaseIngredient ingredient) { if (ingredient == null) { return; } if (!ingredients.Contains(ingredient)) { return; } ingredients.Remove(ingredient); if (onChanged != null) { onChanged.Invoke(this); } }
private void InitIngredients() { BaseIngredient Water = new BaseIngredient(Strings.WATER, "Water.jpeg"); ListOfIngredients.Add(Strings.WATER, Water); BaseIngredient Herb = new BaseIngredient(Strings.HERB, "Herb.jpeg"); ListOfIngredients.Add(Strings.HERB, Herb); BaseIngredient Oil = new BaseIngredient(Strings.OIL, "Oil.jpeg"); ListOfIngredients.Add(Strings.OIL, Oil); BaseIngredient PhoenixAsh = new BaseIngredient(Strings.PHOENIXASH, "PhoenixAsh.jpeg"); ListOfIngredients.Add(Strings.PHOENIXASH, PhoenixAsh); BaseIngredient CristalFlower = new BaseIngredient(Strings.CRISTALFLOWER, "CristalFlower.jpeg"); ListOfIngredients.Add(Strings.CRISTALFLOWER, CristalFlower); }
public void UnShow(BaseIngredient ingredient) { if (leftSlot == ingredient) { leftSlot = null; } if (rightSlot == ingredient) { rightSlot = null; } if (onImageChanged != null) { Debug.Log(name + " image unshown, listen up."); onImageChanged.Invoke(this); } else { Debug.Log(name + " image unshown, nobody cared."); } }
public bool ShowImage(BaseIngredient ingredient) { if (ingredient == null) { return(false); } switch (ingredient.slot) { default: Debug.Log("Doesn't know how to use slot " + ingredient.slot); return(false); case ImageSlot.LeftSlot: GlobalParty.chocolateInventory.Add(leftSlot); // UI Lists #9 at 7:00 leftSlot = ingredient; break; case ImageSlot.RightSlot: GlobalParty.ingredientInventory.Add(rightSlot); rightSlot = ingredient; break; // case ImageSlot.ComboSlot: // comboSlot = ingredient; // break; } if (onImageChanged != null) { Debug.Log(name + " image change, listen up."); onImageChanged.Invoke(this); } else { Debug.Log(name + " image change, nobody cared."); } return(true); }
private IBaseRecipe Recipe2() { IBaseRecipe recipe1 = new SweetsRecipe { RecipeName = "Calitate cu dulceata", RecipeDescriptions = "Cand ai chef de clatite..." }; BaseIngredient ingredient1 = new BaseIngredient { Name = "Dulceata de visine", Quantity = "un borcan" }; BaseIngredient ingredient2 = new BaseIngredient { Name = "Faina", Quantity = "un pahar" }; BaseIngredient ingredient3 = new BaseIngredient { Name = "Apa minerala", Quantity = "un sfert de pahar" }; List <BaseIngredient> baseIngredients1 = new List <BaseIngredient>() { ingredient1, ingredient2, ingredient3 }; recipe1.AddMoreIngredients(baseIngredients1); return(recipe1); }
private IBaseRecipe Recipe1() { IBaseRecipe recipe1 = new SweetsRecipe { RecipeName = "Placinta cu mere", RecipeDescriptions = "O placinta buna" }; BaseIngredient ingredient1 = new BaseIngredient { Name = "Mere", Quantity = "20" }; BaseIngredient ingredient2 = new BaseIngredient { Name = "Faina", Quantity = "4 pahare" }; BaseIngredient ingredient3 = new BaseIngredient { Name = "Drojdie", Quantity = "o bucata" }; List <BaseIngredient> baseIngredients1 = new List <BaseIngredient>() { ingredient1, ingredient2, ingredient3 }; recipe1.AddMoreIngredients(baseIngredients1); return(recipe1); }
public void AddIngredient(BaseIngredient baseIngredient) { _baseIngredients.Add(baseIngredient); }
public bool isCountOfIngredience(BaseIngredient searchIngredience, int needCount) { int count = 0; foreach (BaseIngredient itemInList in ingredieceInventory) { if (itemInList == searchIngredience) { count++; } } if(count >= needCount) { return true; } return false; }
public int getCountOfIngredience(BaseIngredient searchIngredience) { int count = 0; foreach (BaseIngredient itemInList in ingredieceInventory) { if (itemInList == searchIngredience) { count++; } } return count; }
///INGREDIENCE public void addIngredience(BaseIngredient newIngredience) { ingredieceInventory.Add(newIngredience); }
void HandleonClick(BaseIngredient ingredient) { Debug.Log("BEHOLD I HAVE HEARD OF A LEGENDARY " + ingredient.displayName); }
public bool removeCountOfIngredience(BaseIngredient searchIngredience, int needCount) { List<BaseIngredient> items = new List<BaseIngredient>(); foreach (BaseIngredient itemInList in ingredieceInventory) { if (itemInList == searchIngredience) { items.Add(itemInList); } } if(items.Count>= needCount) { for (int i = 0; i < needCount; i++ ) { ingredieceInventory.Remove(searchIngredience); } return true; } return false; }
public BaseIngredient[] GetAllIngredients() { BaseIngredient[] Values = new BaseIngredient[ListOfIngredients.Count]; ListOfIngredients.Values.CopyTo(Values, 0); return Values; }