phaser/src/events/EventEmitter.js

56 lines
1 KiB
JavaScript
Raw Normal View History

var Class = require('../utils/Class');
var EE = require('eventemitter3');
2018-01-18 05:19:00 +00:00
var PluginManager = require('../plugins/PluginManager');
2018-01-31 13:54:44 +00:00
/**
* @namespace Phaser.Events
*/
var EventEmitter = new Class({
Extends: EE,
initialize:
2018-01-26 03:40:49 +00:00
/**
* EventEmitter is a Scene Systems plugin compatible version of eventemitter3.
*
* @class EventEmitter
* @extends eventemitter3
* @memberOf Phaser.Events
* @constructor
* @since 3.0.0
*/
function EventEmitter ()
{
EE.call(this);
2018-01-18 05:19:00 +00:00
},
2018-01-26 03:40:49 +00:00
/**
* Removes all listeners.
*
* @method Phaser.Events.EventEmitter#shutdown
* @since 3.0.0
*/
2018-01-18 05:19:00 +00:00
shutdown: function ()
{
this.removeAllListeners();
},
2018-01-26 03:40:49 +00:00
/**
* Removes all listeners.
*
* @method Phaser.Events.EventEmitter#destroy
* @since 3.0.0
*/
2018-01-18 05:19:00 +00:00
destroy: function ()
{
this.removeAllListeners();
}
});
2018-01-18 05:19:00 +00:00
PluginManager.register('EventEmitter', EventEmitter, 'events');
module.exports = EventEmitter;