"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SetLandmarkSizeUndoRedo = void 0;
const DispatchStateChangeUC_1 = require("../../Dispatcher/UC/DispatchStateChangeUC");
const UndoRedoEntity_1 = require("../../UndoRedo/Entities/UndoRedoEntity");
class SetLandmarkSizeUndoRedo {
    constructor(data, appObjects) {
        this.data = data;
        this.appObjects = appObjects;
        this.undoAction = () => {
            const { landmark, undoSize } = this.data;
            landmark.size = undoSize;
            (0, DispatchStateChangeUC_1.dispatchStateChange)(this.appObjects);
        };
        this.redoAction = () => {
            const { landmark, redoSize } = this.data;
            landmark.size = redoSize;
            (0, DispatchStateChangeUC_1.dispatchStateChange)(this.appObjects);
        };
        const undoRedo = UndoRedoEntity_1.UndoRedoEntity.get(appObjects);
        if (!undoRedo) {
            appObjects.submitWarning("SetLandmarkSizeUndoRedo", "Unable to find UndoRedoEntity");
            return;
        }
        undoRedo.submitAction(this);
    }
}
exports.SetLandmarkSizeUndoRedo = SetLandmarkSizeUndoRedo;
//# sourceMappingURL=SetLandmarkSizeUndoRedo.js.map