"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StoredView = void 0;
exports.makeStoredView = makeStoredView;
const core_1 = require("@vived/core");
class StoredView extends core_1.AppObjectEntity {
}
exports.StoredView = StoredView;
StoredView.type = "STORED_VIEW";
StoredView.get = (appObjects) => (0, core_1.getSingletonComponent)(StoredView.type, appObjects);
function makeStoredView(appObj) {
    return new StoredViewImp(appObj);
}
class StoredViewImp extends StoredView {
    get position() {
        return this._position;
    }
    set position(p) {
        if (core_1.Vector3.Equal(this._position, p))
            return;
        this._position = p;
        this.notifyOnChange();
    }
    get rotation() {
        return this._rotation;
    }
    set rotation(r) {
        if (core_1.Quaternion.Equal(this._rotation, r))
            return;
        this._rotation = r;
        this.notifyOnChange();
    }
    get scale() {
        return this._memoizedScale.val;
    }
    set scale(s) {
        this._memoizedScale.val = s;
    }
    get hasStoredView() {
        return this._memoizedHasStoredView.val;
    }
    set hasStoredView(hasStoredValue) {
        this._memoizedHasStoredView.val = hasStoredValue;
    }
    constructor(appObject) {
        super(appObject, StoredView.type);
        this._position = core_1.Vector3.Zero();
        this._rotation = core_1.Quaternion.Identity();
        this._memoizedScale = new core_1.MemoizedNumber(1, this.notifyOnChange);
        this._memoizedHasStoredView = new core_1.MemoizedBoolean(false, this.notifyOnChange);
    }
}
//# sourceMappingURL=StoredView.js.map