import { AppObjectEntityRepo, generateUniqueID, getSingletonComponent, } from "@vived/core";
import { makeGlbModelEntity } from "./GlbModelEntity";
export class GlbModelRepo extends AppObjectEntityRepo {
    static get(appObjects) {
        return getSingletonComponent(GlbModelRepo.type, appObjects);
    }
}
GlbModelRepo.type = "GlbModelRepo";
export function makeGlbModelRepo(appObject) {
    return new GlbModelRepoImp(appObject);
}
class GlbModelRepoImp extends GlbModelRepo {
    constructor(appObject) {
        super(appObject, GlbModelRepo.type);
        this.glbModelFactory = (id) => {
            const ao = this.appObjects.getOrCreate(id);
            return makeGlbModelEntity(ao);
        };
        this.createGlbModel = (id) => {
            const idToUse = id ?? generateUniqueID();
            const object = this.glbModelFactory(idToUse);
            this.add(object);
            return object;
        };
    }
}
//# sourceMappingURL=GblModelRepo.js.map