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

    @_parent = null
    @_children = []

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

      for child in @_children
        child._update frameCount

  destroy: ->
    @onDestroy?()

      @_children.splice i, 1
      task._parent = null

DivSugar.rootTask = DivSugar.createTask('root')
