import { AppObjectEntity, getSingletonComponent, MemoizedString, RangedNumber } from "@vived/core";
export var Environments;
(function (Environments) {
    Environments["FOREST"] = "Forest";
    Environments["NIGHT"] = "Night";
    Environments["PARKING"] = "Parking";
    Environments["ROOM"] = "Room";
    Environments["STUDIO"] = "Studio";
})(Environments || (Environments = {}));
export class EnvironmentEntity extends AppObjectEntity {
}
EnvironmentEntity.type = "EnvironmentEntity";
EnvironmentEntity.get = (appObjects) => getSingletonComponent(EnvironmentEntity.type, appObjects);
export function makeEnvironmentEntity(appObject) {
    return new EnvironmentEntityImp(appObject);
}
class EnvironmentEntityImp extends EnvironmentEntity {
    get intensity() {
        return this.rangedIntensity.val;
    }
    set intensity(val) {
        this.rangedIntensity.val = val;
    }
    get currentEnvironment() {
        return this._memoizedCurEnv.val;
    }
    set currentEnvironment(curEnv) {
        this._memoizedCurEnv.val = curEnv;
    }
    constructor(appObject) {
        super(appObject, EnvironmentEntity.type);
        this.rangedIntensity = new RangedNumber({
            initialValue: 0.75,
            max: 1.5,
            min: 0.5,
        }, this.notifyOnChange);
        this._defaultEnv = Environments.STUDIO;
        this._memoizedCurEnv = new MemoizedString(Environments.STUDIO, this.notifyOnChange);
        this.setToDefault = () => {
            if (this._memoizedCurEnv.val !== this._defaultEnv) {
                this._memoizedCurEnv.val = this._defaultEnv;
                this.notifyOnChange();
            }
        };
        this.appObjects.registerSingleton(this);
    }
}
//# sourceMappingURL=Environment.js.map