コード例 #1
0
 public ScheduledDay(ActivityTaskSchedule schedule, int dayNumber)
 {
     this.schedule = schedule;
     if (Scribe.mode == LoadSaveMode.Inactive)
     {
         this.dayNumber = dayNumber;
         tasks          = new List <ActivityTask>();
     }
 }
コード例 #2
0
 public ScheduledDay(ScheduledDay day)
 {
     this.schedule  = day.schedule;
     this.dayNumber = day.dayNumber;
     this.tasks     = new List <ActivityTask>();
     foreach (var task in day.tasks)
     {
         this.tasks.Add(new ActivityTask(task));
     }
 }
コード例 #3
0
        private Job StartOrResumeBillJob(Pawn pawn, Building_ReligiousBuildingFacility giver)
        {
            ActivityTaskSchedule schedule = giver.TaskSchedule;

            foreach (ActivityTask task in schedule.TodayTasks)
            {
                if ((Find.TickManager.TicksGame >= task.LastIngredientSearchFailTicks + ReCheckFailedBillTicksRange.RandomInRange || FloatMenuMakerMap.makingFor == pawn))
                {
                    task.LastIngredientSearchFailTicks = 0;
                    if (task.ShouldDoNow() && task.PawnAllowedToStartAnew(pawn))
                    {
                        if (!TryFindRestrictedIngridients(task, pawn, giver, chosenIngThings) && !TryFindBestTaskIngredients(task, pawn, giver, chosenIngThings))
                        {
                            if (FloatMenuMakerMap.makingFor != pawn)
                            {
                                task.LastIngredientSearchFailTicks = Find.TickManager.TicksGame;
                            }
                            else
                            {
                                JobFailReason.Is("MissingMaterials".Translate(), task.Label);
                            }
                            this.chosenIngThings.Clear();
                        }
                        else
                        {
                            Job job = this.TryStartNewDoBillJob(pawn, task, giver);
                            this.chosenIngThings.Clear();
                            return(job);
                        }
                    }
                }
            }

            this.chosenIngThings.Clear();
            return((Job)null);
        }
コード例 #4
0
 public Building_ReligiousBuildingFacility()
 {
     this.taskSchedule = new ActivityTaskSchedule(this);
 }