*** empty log message ***

This commit is contained in:
Darren Ranalli 2001-02-07 19:21:05 +00:00
parent 623a770f4b
commit 977ef4dfbc

View File

@ -25,8 +25,9 @@ def getTimeFrame():
class Task:
def __init__(self, callback):
def __init__(self, callback, priority = 0):
self.__call__ = callback
self.__priority__ = priority
self.uponDeath = None
def setStartTimeFrame(self, startTime, startFrame):
@ -202,7 +203,17 @@ class TaskManager:
TaskManager.notify.debug('spawning task named: ' + name)
task.name = name
task.setStartTimeFrame(self.currentTime, self.currentFrame)
self.taskList.append(task)
# search back from the end of the list until we find a
# task with a lower priority, or we hit the start of the list
index = len(self.taskList) - 1
while (1):
if (index < 0):
break
if (self.taskList[index].__priority__ <= task.__priority__):
break
index = index - 1
index = index + 1
self.taskList.insert(index, task)
return task
def doMethodLater(self, delayTime, func, taskName):