示例#1
0
     of an object", function (done) {
   var game = new Manager()
   var obj = {
     foo: function () {
       assert(true)
       done()
     }
   }
   game.addListeners(obj)
   game.emit('foo')
 })
示例#2
0
 it("should work with components", function (done) {
   var game = new Manager()
   var obj = {
     foo: function (_e) {
       assert(e===_e)
       done()
     }
   }
   var e = game.createEntity(obj)
   game.addListeners(obj)
   game.emit('foo')
 })
示例#3
0
 it("should pass arguments", function (done) {
   var game = new Manager()
   var obj = {
     foo: function (e, a, b) {
       assert('bar'===a)
       assert(101===b)
       done()
     }
   }
   game.createEntity(obj)
   game.addListeners(obj)
   game.emit('foo', 'bar', 101)
 })