public void Register(Recipe recipe) { this.Log($"Production registry registering {recipe}"); if (!Recipes.Contains(recipe)) { Recipes.Add(recipe); } if (!ProductionRoutines.ContainsKey(recipe)) { ProductionRoutines.Add(recipe, null); } if (!ProductionPercentages.ContainsKey(recipe)) { ProductionPercentages.Add(recipe, 0); } }
public bool IsProducing(Recipe recipe) => recipe && ProductionRoutines.ContainsKey(recipe) && ProductionRoutines[recipe] != null;
public bool IsRegistered(Recipe recipe) => Recipes.Contains(recipe) && ProductionRoutines.ContainsKey(recipe) && ProductionPercentages.ContainsKey(recipe);