public override void MapComponentTick() { // No Rare version of MapComponentTick, so this will do. if (!AncestorUtils.IsIntervalTick()) { return; } if (!this.initialized) { this.Initialize(); } for (int i = this.despawnBuffer.Count - 1; i >= 0; i--) { this.DespawnVisitor(this.despawnBuffer[i]); } if (!this.visitSchedule.IsScheduledForCurrentSeason) { this.visitSchedule = AncestorVisitScheduler.BuildSeasonScheduleForCurrentSeason(); } this.visitSchedule.VisitScheduleTickInterval(); this.approval.ApprovalTrackerTickInterval(this); this.timer.AncestorMemoTimerTickInterval(this.approval); }
private void Initialize() { var introDef = DefDatabase <ConceptDef> .GetNamed("MTW_AncestorShrineIntro"); LessonAutoActivator.TeachOpportunity(introDef, OpportunityType.Important); if (this.AncestorFaction != null) { while (this.unspawnedAncestors.Count() < AncestorConstants.MIN_ANCESTORS) { this.unspawnedAncestors.Add(this.GenAncestor()); } } else { this.AlertNullFaction(); } this.visitSchedule = AncestorVisitScheduler.BuildSeasonScheduleForCurrentSeason(); this.visitSchedule.DisableAlreadyPassedVisits(); this.approval = new ApprovalTracker(); this.timer = new AncestorMemoTimer(); this.initialized = true; }