decord/source/modules/games/utils/getApplicationIdsForGame.tsx

82 lines
2.6 KiB
TypeScript
Raw Normal View History

// Module ID: 11662
// Function ID: 11663
2026-09-03 10:05:34 +00:00
// Name: getApplicationIdsForGame
// Dependencies: [4866, 1917, 504, 2]
// Exports: default, useApplicationIdsForGame
2026-09-03 10:05:34 +00:00
// Module 11662 (getApplicationIdsForGame)
import ApplicationStore from "ApplicationStore" /* 4866 */;
import GameStore from "GameStore" /* 1917 */;
2026-09-03 10:05:34 +00:00
const require = globalThis.__r;
const require = fn;
const size = fn(2);
const result = size.fileFinishedImporting("modules/games/utils/getApplicationIdsForGame.tsx");
2026-09-03 10:05:34 +00:00
export default function getApplicationIdsForGame(gameId) {
2026-09-03 10:05:34 +00:00
const set = new Set();
if (null != gameId) {
set.add(gameId);
const game = GameStore.getGame(gameId);
2026-09-03 10:05:34 +00:00
if (game != null) {
const linkedApplications = game.linkedApplications;
2026-09-03 10:05:34 +00:00
if (linkedApplications != null) {
const item = linkedApplications.forEach((id) => set.add(id.id));
2026-09-03 10:05:34 +00:00
}
}
const application = ApplicationStore.getApplication(gameId);
2026-09-03 10:05:34 +00:00
if (application != null) {
const linkedGames = application.linkedGames;
if (linkedGames != null) {
const item1 = linkedGames.forEach((id) => {
set.add(id.id);
game = game.getGame(id.id);
2026-09-03 10:05:34 +00:00
if (game != null) {
const linkedApplications = game.linkedApplications;
if (linkedApplications != null) {
const item = linkedApplications.forEach((id) => set.add(id.id));
}
}
});
}
}
}
return set;
};
export const useApplicationIdsForGame = function useApplicationIdsForGame(gameId) {
_require = gameId;
const items = [GameStore, ApplicationStore];
const items1 = [gameId];
return require("initialize").useStateFromStoresArray(items, () => {
const set = new Set();
if (null != closure_0) {
set.add(tmp);
game = GameStore.getGame(tmp);
if (game != null) {
let linkedApplications = game.linkedApplications;
if (linkedApplications != null) {
let item = linkedApplications.forEach((id) => set.add(id.id));
}
}
const application = ApplicationStore.getApplication(tmp);
if (application != null) {
const linkedGames = application.linkedGames;
if (linkedGames != null) {
const item1 = linkedGames.forEach((id) => {
set.add(id.id);
game = game.getGame(id.id);
if (game != null) {
const linkedApplications = game.linkedApplications;
if (linkedApplications != null) {
const item = linkedApplications.forEach((id) => set.add(id.id));
}
}
});
}
}
}
return Array.from(set);
}, items1);
};