コード例 #1
0
        private LinkedListNode <ISuperInvokeRunnable> GetPoolNode(ISuperInvokeRunnable value)
        {
            var node = SuperInvokePoolHolder.PoolManager.GetInstance <LinkedListNode <ISuperInvokeRunnable> >();

            node.Value = value;
            return(node);
        }
コード例 #2
0
        private void ReschedulingAfterExecution()
        {
            for (LinkedListNode <ISuperInvokeRunnable> node = executionQueue.First;
                 node != null;
                 node = node.Next)
            {
                ISuperInvokeRunnable runnable = node.Value;

                if (runnable.NoMoreTasks())
                {
                    if (runnable.GetJobState() != JobState.Killed)
                    {
                        runnable.Complete();
                    }
                    runnable.RemovedFromScheduler(); //ended
                }
                else if (killAfterExecutionBag.Contains(runnable))
                {
                    runnable.RemovedFromScheduler(); //killed
                }
                else if (pauseAfterExecutionBag.Contains(runnable))
                {
                    pauseQueue.AddLast(runnable); //paused
                }
                else
                {
                    scheduleQueue.AddLast(runnable);
                }
            }

            killAfterExecutionBag.Clear();
            pauseAfterExecutionBag.Clear();
        }
コード例 #3
0
        internal void ScheduleTask(ISuperInvokeRunnable superInvokeRunnable)
        {
            if (superInvokeRunnable is Sequence)
            {
                ((Sequence)superInvokeRunnable).AddedToScheduler();
            }

            superInvokeRunnable.SetTriggerTime(SystemTime.Current);

            scheduleQueue.AddLast(GetPoolNode(superInvokeRunnable));
        }
コード例 #4
0
        private static IJob ActualRun(Action method, float delay, string tag)
        {
            CheckMethod(method);
            CheckDelay(delay);

            Job job = new Job();
            ISuperInvokeRunnable runnable = SingleTask.MakeInstance(method, delay, tag);

            runnable.SetJob(job);

            ScheduleBridge.Schedule(runnable);
            return(job);
        }
コード例 #5
0
        private bool HasAnyOfTheseTags(ISuperInvokeRunnable runnable, SuperInvokeTag[] tags)
        {
            bool hasAnyOfTheseTags = false;

            int i = 0;

            while (i < tags.Length && !hasAnyOfTheseTags)
            {
                hasAnyOfTheseTags = runnable.HasThisTag(tags[i]);
                i++;
            }

            return(hasAnyOfTheseTags);
        }
コード例 #6
0
 internal static void Schedule(ISuperInvokeRunnable runnable)
 {
     GrabManager();
     superInvokeManager.ScheduleTask(runnable);
 }