@csegames/camelot-unchained
Version:
Camelot Unchained Client Library
31 lines (30 loc) • 1.07 kB
JavaScript
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
;
Object.defineProperty(exports, "__esModule", { value: true });
var BuildingEventTopics_1 = require("./BuildingEventTopics");
var client_1 = require("../../core/client");
function run(emitter, topic) {
if (client_1.default.OnBlockSelected) {
client_1.default.OnCopyBlueprint(function () {
emitter.emit(BuildingEventTopics_1.default.handlesBlueprintCopy, {});
});
}
}
var BlockSelectListener = function () {
function BlockSelectListener() {
this.listening = false;
this.topic = BuildingEventTopics_1.default.handlesBlueprintCopy;
}
BlockSelectListener.prototype.start = function (emitter) {
if (!this.listening) {
this.listening = true;
run(emitter, this.topic);
}
};
return BlockSelectListener;
}();
exports.default = BlockSelectListener;