"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.$ = void 0;
const EventEmitter_1 = require("../EventEmitter");
const global_1 = require("../global");
class $ extends EventEmitter_1.EventEmitter {
    constructor(system) {
        super();
        this.__ = [];
        this.__system = system;
        this.__global_id = (0, global_1.setGlobalRef)(this.__system, this);
    }
    getGlobalId() {
        return this.__global_id;
    }
    getInterface() {
        return this.__;
    }
    refSystem() {
        return this.__system;
    }
    destroy() {
        (0, global_1.deleteGlobalRef)(this.__system, this.__global_id);
        this.emit('destroy');
    }
}
exports.$ = $;
//# sourceMappingURL=$.js.map