var __reflect = (this && this.__reflect) || function (p, c, t) {
    p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
};
var BaseControl = (function () {
    function BaseControl() {
        this._bus = SignBus.instance;
        this._commandNotification = new Notification(Notification.COMMAND);
        this._commandData = {};
    }
    BaseControl.prototype.on = function (notification, handler, priority) {
        if (priority === void 0) { priority = 0; }
        this._bus.addEventListener(notification, handler, this, false, priority);
    };
    BaseControl.prototype.off = function (notification, handler) {
        this._bus.removeEventListener(notification, handler, this);
    };
    BaseControl.prototype.send = function (notification, data) {
        if (data === void 0) { data = null; }
        this._bus.dispatchEvent(new Notification(notification, data));
    };
    BaseControl.prototype.sendCommand = function (notification, data) {
        if (data === void 0) { data = null; }
        this._commandData.command = notification;
        this._commandData.data = data;
        this._commandNotification.data = this._commandData;
        this._bus.dispatchEvent(this._commandNotification);
    };
    BaseControl.prototype.start = function () {
        if (!this._running) {
            this.initListener();
            this._running = true;
        }
    };
    BaseControl.prototype.stop = function () {
        this._running = false;
        this.removeListener();
    };
    BaseControl.prototype.initListener = function () {
    };
    BaseControl.prototype.removeListener = function () {
    };
    return BaseControl;
}());
__reflect(BaseControl.prototype, "BaseControl");
//# sourceMappingURL=BaseControl.js.map