// #region Imports
/**
 * The base class for all controllers.
 *
 * @public
 * @abstract
 */
export class ControllerBase {
    // #region Fields
    _host;
    _isConnected;
    _hasUpdated;
    // #endregion
    // #region Ctor
    /**
     * Constructs a new instance of the `ControllerBase` class.
     *
     * @public
     * @protected
     */
    constructor(host) {
        this._host = host;
        this._isConnected = false;
        this._hasUpdated = false;
        host.addController(this);
    }
    // #endregion
    // #region Properties
    /**
     * Gets the host property.
     *
     * @protected
     * @readonly
     */
    get host() {
        return this._host;
    }
    /**
     * Gets a value indicating whether the controller is connected.
     *
     * @protected
     * @readonly
     */
    get isConnected() {
        return this._isConnected;
    }
    // #endregion
    // #region Methods
    /**
     * @public
     * @virtual
     */
    hostConnected() {
        this._isConnected = true;
    }
    /**
     * @public
     * @virtual
     */
    hostDisconnected() {
        this._isConnected = false;
    }
    /**
     * @public
     * @virtual
     */
    hostUpdate() { }
    /**
     * @public
     * @virtual
     */
    hostUpdated() {
        if (!this._hasUpdated) {
            this._hasUpdated = true;
            this.hostFirstUpdated();
        }
    }
    /**
     * @public
     * @virtual
     */
    hostFirstUpdated() { }
}
//# sourceMappingURL=ControllerBase.js.map