UNPKG

@evitcastudio/kit

Version:

A single-player/multiplayer framework for the Vylocity Game Engine.

25 lines (24 loc) 629 B
export class KitPlugin { /** * The emitter that belongs to this plugin. */ _emitter = null; /** * Register this plugin with the event system. * @param pEmitter - The emitter that belongs to this plugin. */ _register(pEmitter) { this._emitter = pEmitter; } /** * Emit an event. * @param pEvent - The event to emit. */ emit(pEvent) { if (!this._emitter) { console.error('[Kit Plugin] emitter not set. This is an indication that the plugin is not registered.'); return; } this._emitter.emit(pEvent); } }