示例#1
0
        public override void ExposeData()
        {
            base.ExposeData();

            Scribe_Deep.LookDeep(ref Bill, "Bill");

            // init main product, required by trigger.
            if (MainProduct == null)
            {
                MainProduct = new MainProductTracker(Bill.recipe);
            }

            Scribe_Deep.LookDeep(ref Trigger, "trigger", manager);
            Scribe_Values.LookValue(ref _hasMeaningfulIngredientChoices, "hasMeaningFulIngredientChoices", false);
            Scribe_Values.LookValue(ref _createIngredientBills, "createIngredientBills", true);

            // bill giver tracking is going to error out in cross-map import/export, so create a new one.
            if (Manager.LoadSaveMode == Manager.Modes.Normal)
            {
                Scribe_Deep.LookDeep(ref BillGivers, "BillGivers", this);
            }
            else
            {
                BillGivers = new BillGiverTracker(this);
            }
            Scribe_Values.LookValue(ref restrictToMaxSkill, "maxSkill", false);

            // scribe history in normal load/save only.
            if (Manager.LoadSaveMode == Manager.Modes.Normal)
            {
                Scribe_Deep.LookDeep(ref History, "History");
            }
        }
        public ManagerJob_Production( RecipeDef recipe )
        {
            Bill = recipe.UsesUnfinishedThing ? new Bill_ProductionWithUft( recipe ) : new Bill_Production( recipe );
            _hasMeaningfulIngredientChoices = Dialog_CreateJobsForIngredients.HasPrerequisiteChoices( recipe );
            MainProduct = new MainProductTracker( Bill.recipe );
            Trigger = new Trigger_Threshold( this );
            BillGivers = new BillGiverTracker( this );

            History = new History( new[] { Trigger.ThresholdFilter.Summary } );
        }
示例#3
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 });
        }
示例#4
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;
        }
        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;
        }
        public override void ExposeData()
        {
            base.ExposeData();

            Scribe_Deep.LookDeep( ref Bill, "Bill" );
            Scribe_Values.LookValue( ref _hasMeaningfulIngredientChoices, "hasMeaningFulIngredientChoices", false );
            Scribe_Values.LookValue( ref _createIngredientBills, "createIngredientBills", true );

            // bill giver tracking is going to error out in cross-map import/export, so create a new one.
            if ( Manager.LoadSaveMode == Manager.Modes.Normal )
            {
                Scribe_Deep.LookDeep( ref BillGivers, "BillGivers", this );
            }
            else
            {
                BillGivers = new BillGiverTracker( this );
            }
            Scribe_Values.LookValue( ref restrictToMaxSkill, "maxSkill", false );

            // init main product, required by trigger.
            if ( MainProduct == null )
            {
                MainProduct = new MainProductTracker( Bill.recipe );
            }

            Scribe_Deep.LookDeep( ref Trigger, "Trigger", this );

            // scribe history in normal load/save only.
            if ( Manager.LoadSaveMode == Manager.Modes.Normal )
            {
                Scribe_Deep.LookDeep( ref History, "History" );
            }
        }