"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Hideable = void 0;
const core_1 = require("@vived/core");
class Hideable extends core_1.AppObjectEntity {
    static addIfMissing(appObj) {
        const existing = appObj.getComponent(this.type);
        if (existing) {
            return existing;
        }
        else {
            return new Hideable(appObj);
        }
    }
    static get(appObjID, appObjects) {
        const appObj = appObjects.get(appObjID);
        if (appObj === undefined) {
            return undefined;
        }
        return appObj.getComponent(Hideable.type);
    }
    get isHidden() {
        return this.memoizedIsHidden.val;
    }
    set isHidden(val) {
        this.memoizedIsHidden.val = val;
    }
    constructor(appObject) {
        super(appObject, Hideable.type);
        this.ignoreSerialization = false;
        this.memoizedIsHidden = new core_1.MemoizedBoolean(false, this.notifyOnChange);
    }
}
exports.Hideable = Hideable;
Hideable.type = "HIDEABLE";
//# sourceMappingURL=Hideable.js.map