//called to complete the first task in the queue
        public void OnTaskCompleted()
        {
            if (tasksQueue.Count == 0) //if there are no tasks in the queue then do not proceed
            {
                return;
            }

            int completedTaskID = tasksQueue[0];                    //get the first pending task and remove it from the queue

            tasksQueue.RemoveAt(0);                                 //remove from task queue

            tasksList[completedTaskID].Complete();                  //complete the task

            CustomEvents.OnTaskCompleted(this, completedTaskID, 0); //custom delegate event

            StartNextTask();                                        //start the next task in queue
        }
示例#2
0
        //called to complete the first task in the queue
        public void OnTaskCompleted()
        {
            if (tasksQueue.Count == 0) //if there are no tasks in the queue then do not proceed
            {
                return;
            }

            int completedTaskID = tasksQueue[0];                           //get the first pending task and remove it from the queue

            tasksQueue.RemoveAt(0);                                        //remove from task queue

            tasksList[completedTaskID].Complete();                         //complete the task

            CustomEvents.OnTaskCompleted(this, completedTaskID, 0);        //custom delegate event

            if (tasksQueue.Count > 0)                                      //if there are still more tasks in the queue
            {
                taskQueueTimer = tasksList[tasksQueue[0]].GetReloadTime(); //start the timer for the next one.
            }
        }