decord/source/stores/RegionStore.tsx

97 lines
2.5 KiB
TypeScript
Raw Normal View History

2026-08-08 06:10:11 +00:00
// Module ID: 15877
// Function ID: 15878
2026-07-29 08:29:29 +00:00
// Name: initialize
2026-08-06 08:05:19 +00:00
// Dependencies: [1891, 12, 589, 709, 2]
2026-07-23 10:11:24 +00:00
2026-08-08 06:10:11 +00:00
// Module 15877 (initialize)
2026-07-29 08:29:29 +00:00
import createGuildRecordFromRust from "createGuildRecordFromRust";
import { Store } from "initialize";
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
let c3 = null;
let closure_4 = {};
class RegionStore extends Store {
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const prototype = RegionStore.prototype;
prototype["initialize"] = function initialize() {
this.waitFor(createGuildRecordFromRust);
};
prototype["getOptimalRegion"] = function getOptimalRegion(guildId) {
let tmp = guildId;
if (guildId === undefined) {
tmp = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const regions = this.getRegions(tmp);
let tmp2 = null;
if (null != regions) {
let found = regions.find((optimal) => optimal.optimal);
if (found == null) {
found = importDefault(12).sample(regions);
const obj = importDefault(12);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp2 = found;
}
return tmp2;
};
prototype["getOptimalRegionId"] = function getOptimalRegionId(guildId) {
let tmp = guildId;
if (guildId === undefined) {
tmp = null;
}
const optimalRegion = this.getOptimalRegion(tmp);
let id = null;
if (null != optimalRegion) {
id = optimalRegion.id;
}
return id;
};
prototype["getRandomRegion"] = function getRandomRegion(guildId) {
let tmp = guildId;
if (guildId === undefined) {
tmp = null;
}
const regions = this.getRegions(tmp);
let sampleResult = null;
if (null != regions) {
sampleResult = importDefault(12).sample(regions);
const obj = importDefault(12);
}
return sampleResult;
};
prototype["getRandomRegionId"] = function getRandomRegionId(guildId) {
let tmp = guildId;
if (guildId === undefined) {
tmp = null;
}
const randomRegion = this.getRandomRegion(tmp);
let id = null;
if (null != randomRegion) {
id = randomRegion.id;
}
return id;
};
prototype["getRegions"] = function getRegions(guildId) {
if (null != guildId) {
let tmp = table[guildId];
} else {
tmp = c3;
}
return tmp;
};
RegionStore.displayName = "RegionStore";
const regionStore = new RegionStore(require("dispatcher"), {
2026-07-20 16:05:17 +00:00
LOAD_REGIONS: function handleLoadRegions(regions) {
2026-07-29 08:29:29 +00:00
const sortByResult = importDefault(12).sortBy(regions.regions, (name) => name.name);
2026-07-20 16:05:17 +00:00
if (null != regions.guildId) {
2026-07-29 08:29:29 +00:00
closure_4[regions.guildId] = sortByResult;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
let c3 = sortByResult;
2026-07-20 16:05:17 +00:00
}
},
GUILD_DELETE: function handleDeleteGuild(arg0) {
2026-07-23 10:11:24 +00:00
delete tmp2[tmp];
2026-07-20 16:05:17 +00:00
}
});
2026-07-29 08:29:29 +00:00
const result = require("initialize").fileFinishedImporting("stores/RegionStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default regionStore;