import { dispatchStateChange } from "../../Dispatcher/UC/DispatchStateChangeUC";
import { Hideable } from "../../Hideable/Entities/Hideable";
import { UndoRedoEntity, } from "../../UndoRedo/Entities/UndoRedoEntity";
export class UnhideAllAppObjectsUndoRedo {
    setIsHiddenOnAppObject(isHidden, appObjID) {
        const hideable = Hideable.get(appObjID, this.appObjects);
        if (!hideable)
            return;
        hideable.isHidden = isHidden;
    }
    constructor(appObjectIDs, appObjects) {
        this.appObjectIDs = appObjectIDs;
        this.appObjects = appObjects;
        this.undoAction = () => {
            const appObjectIDs = this.appObjectIDs;
            appObjectIDs.forEach((appObjID) => {
                this.setIsHiddenOnAppObject(true, appObjID);
            });
            dispatchStateChange(this.appObjects);
        };
        this.redoAction = () => {
            const appObjectIDs = this.appObjectIDs;
            appObjectIDs.forEach((appObjID) => {
                this.setIsHiddenOnAppObject(false, appObjID);
            });
            dispatchStateChange(this.appObjects);
        };
        const undoRedo = UndoRedoEntity.get(this.appObjects);
        if (!undoRedo) {
            this.appObjects.submitWarning("UnhideAllAppObjectsUndoRedoDTO", "Unable to find UndoRedoEntity");
            return;
        }
        undoRedo.submitAction(this);
    }
}
//# sourceMappingURL=UnhideAllAppObjectsUndoRedo.js.map