import { AppObjectEntity, getSingletonComponent, MemoizedBoolean, MemoizedVector2, Vector2 } from "@vived/core";
export class BabylonEntity extends AppObjectEntity {
}
BabylonEntity.type = "BabylonEntity";
BabylonEntity.get = (appObjects) => getSingletonComponent(BabylonEntity.type, appObjects);
export function makeBabylonEntity(appObject) {
    return new BabylonEntityImp(appObject);
}
class BabylonEntityImp extends BabylonEntity {
    get workingCanvas() {
        return this._workingCanvas;
    }
    set workingCanvas(canvas) {
        if (canvas === this._workingCanvas)
            return;
        this._workingCanvas = canvas;
        this.notifyOnChange();
    }
    get renderCanvas() {
        return this._renderCanvas;
    }
    set renderCanvas(canvas) {
        if (canvas === this._renderCanvas)
            return;
        this._renderCanvas = canvas;
        this.notifyOnChange();
    }
    get showInspector() {
        return this.memoizedShowInspector.val;
    }
    set showInspector(val) {
        this.memoizedShowInspector.val = val;
    }
    get canvasSize() {
        return this.memoizedCanvasSize.val;
    }
    set canvasSize(val) {
        this.memoizedCanvasSize.val = val;
    }
    get isRendering() {
        return this.memoizedIsRendering.val;
    }
    set isRendering(val) {
        this.memoizedIsRendering.val = val;
    }
    constructor(appObject) {
        super(appObject, BabylonEntity.type);
        this.memoizedShowInspector = new MemoizedBoolean(false, this.notifyOnChange);
        this.memoizedCanvasSize = new MemoizedVector2(Vector2.One(), this.notifyOnChange);
        this.memoizedIsRendering = new MemoizedBoolean(false, this.notifyOnChange);
        this.makeAppObjectMeta = (id) => {
            return { appObjectID: id };
        };
        this.getAppObjectIDFromMeta = (meta) => {
            if (meta?.hasOwnProperty("appObjectID")) {
                return meta.appObjectID;
            }
            else {
                return;
            }
        };
    }
}
//# sourceMappingURL=BabylonEntity.js.map