import { AppObjectEntity, MemoizedBoolean, } from "@vived/core";
export class Hideable extends 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 MemoizedBoolean(false, this.notifyOnChange);
    }
}
Hideable.type = "HIDEABLE";
//# sourceMappingURL=Hideable.js.map