public override void MapComponentTick()
        {
            base.MapComponentTick();

            if (incidentQueue == null)
            {
                CreateNewIncidentQueue();
            }
            incidentQueue.IncidentQueueTick();

            if (eventQueue == null)
            {
                eventQueue = new List <Event>();
            }
            var triggeredEvents = eventQueue.Where(e => -- e.delayTicks <= 0).ToArray();

            foreach (var e in triggeredEvents)
            {
                eventQueue.Remove(e);

                foreach (var action in e.actions)
                {
                    action.DoAction();
                }
            }
        }
        public override void MapComponentTick()
        {
            base.MapComponentTick();

            if (incidentQueue == null)
            {
                incidentQueue = new IncidentQueue();
            }
            if (incidentQueue.Count <= 1)
            {
                GenericUtility.FillIncidentQueue(map);
            }
            incidentQueue.IncidentQueueTick();

            if (GenTicks.TicksGame > nextQueueInspection)
            {
                nextQueueInspection = GenTicks.TicksGame + GenDate.TicksPerDay;
                GenericUtility.CheckTooManyIncidentsAtOnce(incidentQueue);
            }

            if (GenTicks.TicksGame > nextRogueGuestCheck)
            {
                nextRogueGuestCheck = GenTicks.TicksGame + GenDate.TicksPerHour;
                GuestUtility.CheckForRogueGuests(map);
            }

            if (GenTicks.TicksGame > nextGuestListCheck)
            {
                nextGuestListCheck = GenTicks.TicksGame + GenDate.TicksPerDay / 4;
                PresentLords.Clear();
                RefreshGuestListTotal();
            }
        }
Esempio n. 3
0
        public override void MapComponentTick()
        {
            base.MapComponentTick();

            if (incidentQueue == null)
            {
                incidentQueue = new IncidentQueue();
            }
            if (incidentQueue.Count == 0)
            {
                FillIncidentQueue();
            }
            incidentQueue.IncidentQueueTick();
        }