public ScheduledDay(ActivityTaskSchedule schedule, int dayNumber) { this.schedule = schedule; if (Scribe.mode == LoadSaveMode.Inactive) { this.dayNumber = dayNumber; tasks = new List <ActivityTask>(); } }
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)); } }
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); }
public Building_ReligiousBuildingFacility() { this.taskSchedule = new ActivityTaskSchedule(this); }