import { useMainStore } from '@/store';

export default {
    methods: {
        hasSettingEqualTo(settingName, settingValue) {
            return useMainStore().experimentSettings[settingName] === settingValue;
        },
        hasSetting(settingName) {
            return Object.hasOwn(useMainStore().experimentSettings, settingName);
        },
        getExperimentByName(experimentName) {
            const experiment = useMainStore().applicationUser.experiments.find((e) => e.universeName === experimentName);
            return experiment ? experiment : null;
        },
        getSettingValue(settingName) {
            return this.hasSetting(settingName)
                ? useMainStore().experimentSettings[settingName]
                : null;
        }
    }
};
