HasPrerequisiteChoices() public static method

Returns true if the recipe has prerequisite ingredients, and those ingredients can currently be crafted.
public static HasPrerequisiteChoices ( Map map, RecipeDef recipe ) : bool
map Map
recipe RecipeDef
return bool
コード例 #1
0
        public ManagerJob_Production(Manager manager, RecipeDef recipe) : base(manager)
        {
            Bill = recipe.UsesUnfinishedThing ? new Bill_ProductionWithUft(recipe) : new Bill_Production(recipe);
            _hasMeaningfulIngredientChoices = Dialog_CreateJobsForIngredients.HasPrerequisiteChoices(manager, recipe);
            MainProduct = new MainProductTracker(Bill.recipe);
            Trigger     = new Trigger_Threshold(this);
            BillGivers  = new BillGiverTracker(this);

            History = new History(new[] { Trigger.ThresholdFilter.Summary });
        }
コード例 #2
0
        public void SetNewRecipe(RecipeDef newRecipe)
        {
            // clear currently assigned bills.
            CleanUp();

            // set the bill on this job
            Bill = newRecipe.UsesUnfinishedThing
                       ? new Bill_ProductionWithUft(newRecipe)
                       : new Bill_Production(newRecipe);
            _hasMeaningfulIngredientChoices = Dialog_CreateJobsForIngredients.HasPrerequisiteChoices(manager, newRecipe);

            // mainproduct and trigger do not change.
            BillGivers = new BillGiverTracker(this);

            // set the last cache time so it gets updated.
            ForceRecacheOtherRecipe();

            // null targets cache so it gets updated
            _targets = null;
        }