2018-01-12 18:59:01 +00:00
|
|
|
var Class = require('../utils/Class');
|
|
|
|
var EE = require('eventemitter3');
|
2018-01-18 05:19:00 +00:00
|
|
|
var PluginManager = require('../plugins/PluginManager');
|
2018-01-12 18:59:01 +00:00
|
|
|
|
2018-01-31 13:54:44 +00:00
|
|
|
/**
|
|
|
|
* @namespace Phaser.Events
|
|
|
|
*/
|
|
|
|
|
2018-02-07 15:27:21 +00:00
|
|
|
/**
|
|
|
|
* @classdesc
|
|
|
|
* EventEmitter is a Scene Systems plugin compatible version of eventemitter3.
|
|
|
|
*
|
|
|
|
* @class EventEmitter
|
|
|
|
* @extends eventemitter3
|
|
|
|
* @memberOf Phaser.Events
|
|
|
|
* @constructor
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2018-01-12 18:59:01 +00:00
|
|
|
var EventEmitter = new Class({
|
|
|
|
|
|
|
|
Extends: EE,
|
|
|
|
|
|
|
|
initialize:
|
|
|
|
|
|
|
|
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-12 18:59:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2018-01-18 05:19:00 +00:00
|
|
|
PluginManager.register('EventEmitter', EventEmitter, 'events');
|
|
|
|
|
2018-01-12 18:59:01 +00:00
|
|
|
module.exports = EventEmitter;
|