     Handle a single event.
     ###
     handle: (event) ->
-        if @handlers[event.type]
-            for handler in @handlers[event.type]
+        if @handlers[event.constructor.type]
+            for handler in @handlers[event.constructor.type]
                 result = handler event
 
                 if result == false

    @type integer
    @see `loop_forever`
    ###
    loop_delay: 5

    ###
    {@inheritDoc}

    instance-specific logs.
    ###

    ###
    Log a message.
    ###
    log: (args...) ->
        args[0] = "[#{@constructor.name}:#{@_id.substr(0, 8)}] " + args[0]
        console.log.apply console.log, args

    ###
    Log a message.
    ###
    @log: (args...) ->
        args[0] = "[#{@name}] " + args[0]
        console.log.apply console.log, args

    ###
    Constructor.
    ###
    constructor: () ->
