       @_children.splice i, 1
       task._parent = null
 
-  toString: ->
-    # TBD
-
-DivSugar.rootTask = new DivSugar.Task
+DivSugar.rootTask = DivSugar.createTask('root')

    @_parent = null
    @_children = []

  _update: (frameCount) =>
    if @active
      @onUpdate? frameCount

      for child in @_children
        child._update frameCount

  destroy: ->
    @onDestroy?()

class DivSugar._Task
  constructor: (@id) ->
    @active = true
    @onUpdate = null
    @onDestroy = null
