コード例 #1
0
        public ScheduleManager SchedulePeriodicEvent(Event e, ICollection <Entity> entities, float timeInSec)
        {
            PeriodicEventTask task = new PeriodicEventTask(e, this.engineService, entities, timeInSec);

            this.periodicTasks.AddLast(task);
            return(task);
        }
コード例 #2
0
        private void UpdatePeriodicTasks(double time)
        {
            LinkedListNode <PeriodicEventTask> next;

            for (LinkedListNode <PeriodicEventTask> node = this.periodicTasks.First; node != null; node = next)
            {
                PeriodicEventTask task = node.Value;
                next = node.Next;
                if (task.IsCanceled())
                {
                    this.periodicTasks.Remove(node);
                }
                else
                {
                    task.Update(time);
                }
            }
        }