public void AttachRecipe(CraftingRecipe recipeToAttach)
 {
     _attachedRecipe     = recipeToAttach;
     _recipeImage.sprite = recipeToAttach.ItemProduced.Item.Sprite;
 }
 public virtual void CancelProcess()
 {
     _processing = null;
     ResetTimer();
 }
 public virtual void AddProcess(CraftingRecipe recipe)
 {
     // Assign the new recipe and tell listeners about it
     _processing = recipe;
     OnStartProcess?.Invoke(recipe);
 }
Пример #4
0
 public void RegisterProduce(EditorItemStack itemProduced, CraftingRecipe recipe)
 {
     AddToDictionary(_produceRecipes, itemProduced.Item.Id, recipe);
 }
Пример #5
0
        private void AddToDictionary(Dictionary <ushort, List <CraftingRecipe> > dictionary, ushort itemId, CraftingRecipe recipe)
        {
            List <CraftingRecipe> recipesAssociatedWithItem;

            if (!dictionary.TryGetValue(itemId, out recipesAssociatedWithItem))
            {
                recipesAssociatedWithItem = new List <CraftingRecipe>();
                dictionary.Add(itemId, recipesAssociatedWithItem);
            }
            recipesAssociatedWithItem.Add(recipe);
        }
Пример #6
0
 public void RegisterProducedInside(ushort machineId, CraftingRecipe recipe)
 {
     AddToDictionary(_producedInsideOf, machineId, recipe);
 }