示例#1
0
        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);
        }
示例#2
0
        public override void MapConditionTick()
        {
            if (!AncestorUtils.IsIntervalTick())
            {
                return;
            }

            // Remove despawned visitors
            this.visitors = visitors.Where(p => p.Spawned).ToList();

            if (this.visitors.Count == 0)
            {
                this.duration = 0;
                this.SubmitApprovalChanges();
            }
            else
            {
                foreach (Pawn p in this.visitors)
                {
                    this.PawnApprovalTickInterval(p);
                }

                if (this.EstRemainingDays < -1f)
                {
                    this.QueueForcedEnd();
                }
            }
        }