import { AppObjectPM, getSingletonComponent, } from "@vived/core";
import { EnvironmentEntity } from "../Entities/Environment";
export class EnvironmentalIntensityPM extends AppObjectPM {
}
EnvironmentalIntensityPM.type = "EnvironmentalIntensityPM";
EnvironmentalIntensityPM.get = (appObjects) => getSingletonComponent(EnvironmentalIntensityPM.type, appObjects);
export function makeEnvironmentalIntensityPM(appObject) {
    return new EnvironmentalIntensityPMImp(appObject);
}
class EnvironmentalIntensityPMImp extends EnvironmentalIntensityPM {
    vmsAreEqual(a, b) {
        return a === b;
    }
    get entity() {
        return this.getCachedSingleton(EnvironmentEntity.type);
    }
    constructor(appObject) {
        super(appObject, EnvironmentalIntensityPM.type);
        this.onEntityChange = () => {
            if (!this.entity)
                return;
            this.doUpdateView(this.entity.intensity);
        };
        this.entity?.addChangeObserver(this.onEntityChange);
        this.onEntityChange();
        this.appObjects.registerSingleton(this);
    }
}
//# sourceMappingURL=EnvironmentalIntensityPM.js.map