public RecipeEntry(Recipe recipe, bool isProduction, IRecipeItemFlowProvider provider, Goods currentItem) { this.recipe = recipe; var amount = isProduction ? recipe.GetProduction(currentItem) : recipe.GetConsumption(currentItem); recipeFlow = provider.GetRecipeFlow(recipe); flow = recipeFlow * amount; specificEfficiency = isProduction ? recipe.Cost() / amount : 0f; if (!recipe.IsAccessible()) { entryStatus = EntryStatus.NotAccessible; } else if (!recipe.IsAccessibleWithCurrentMilestones()) { entryStatus = EntryStatus.NotAccessibleWithCurrentMilestones; } else { var waste = recipe.RecipeWaste(); if (waste > 0.95f) { entryStatus = EntryStatus.Wasteful; } else if (waste > 0f) { entryStatus = EntryStatus.Normal; } else { entryStatus = EntryStatus.Useful; } } }
public static void Show(Goods goods, IRecipeItemFlowProvider provider) { if (Instance.opened) { Instance.changing = goods; return; } Instance.provider = provider ?? Instance; Instance.SetItem(goods); MainScreen.Instance.ShowPseudoScreen(Instance); }