aboutsummaryrefslogtreecommitdiff
path: root/features/settings/locationSettingHolder.js
blob: af6f507d683f2e069e1bb6bfa4b368735d50b9ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class LocationSettingHolder {
    constructor() {
        this.data = new Set();
    }

    addLocationSetting(setting) {
        this.data.add(setting)
    }

    removeLocationSetting(setting) {
        this.data.delete(setting)
    }

    getData() {
        return [...this.data]
    }
}

if (!global.LocationSettingHolder) {
    global.LocationSettingHolder = new LocationSettingHolder();

    register("gameUnload", () => {
        global.LocationSettingHolder = undefined
    })
}

export default global.LocationSettingHolder;