import { AppObjectUC, getSingletonComponent, } from "@vived/core";
import { Quaternion, Vector3 } from "@vived/core";
import { dispatchStateChange } from "../../Dispatcher";
import { StoredView } from "../Entities";
export class ClearStoredViewUC extends AppObjectUC {
}
ClearStoredViewUC.type = "ClearStoredViewUC";
ClearStoredViewUC.get = (appObjects) => getSingletonComponent(ClearStoredViewUC.type, appObjects);
export function makeClearStoredViewUC(appObject) {
    return new ClearStoredViewUCImp(appObject);
}
class ClearStoredViewUCImp extends ClearStoredViewUC {
    get storedView() {
        return this.getCachedSingleton(StoredView.type);
    }
    constructor(appObject) {
        super(appObject, ClearStoredViewUC.type);
        this.clearStoredView = () => {
            if (!this.storedView)
                return;
            this.storedView.position = Vector3.Zero();
            this.storedView.rotation = Quaternion.Identity();
            this.storedView.scale = 1;
            this.storedView.hasStoredView = false;
            dispatchStateChange(this.appObject.appObjectRepo);
        };
    }
}
//# sourceMappingURL=ClearStoredViewUC.js.map