"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClearStoredViewUC = void 0;
exports.makeClearStoredViewUC = makeClearStoredViewUC;
const core_1 = require("@vived/core");
const core_2 = require("@vived/core");
const Dispatcher_1 = require("../../Dispatcher");
const Entities_1 = require("../Entities");
class ClearStoredViewUC extends core_1.AppObjectUC {
}
exports.ClearStoredViewUC = ClearStoredViewUC;
ClearStoredViewUC.type = "ClearStoredViewUC";
ClearStoredViewUC.get = (appObjects) => (0, core_1.getSingletonComponent)(ClearStoredViewUC.type, appObjects);
function makeClearStoredViewUC(appObject) {
    return new ClearStoredViewUCImp(appObject);
}
class ClearStoredViewUCImp extends ClearStoredViewUC {
    get storedView() {
        return this.getCachedSingleton(Entities_1.StoredView.type);
    }
    constructor(appObject) {
        super(appObject, ClearStoredViewUC.type);
        this.clearStoredView = () => {
            if (!this.storedView)
                return;
            this.storedView.position = core_2.Vector3.Zero();
            this.storedView.rotation = core_2.Quaternion.Identity();
            this.storedView.scale = 1;
            this.storedView.hasStoredView = false;
            (0, Dispatcher_1.dispatchStateChange)(this.appObject.appObjectRepo);
        };
    }
}
//# sourceMappingURL=ClearStoredViewUC.js.map