Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 23 additions & 18 deletions src/model/game/GameManager.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
import {computed, ComputedRef} from 'vue';
import Game from '../../model/game/Game';
import StorePlatformMetadata from '../../model/game/StorePlatformMetadata';
import PathResolver from '../../r2mm/manager/PathResolver';
import FileUtils from '../../utils/FileUtils';
import {EcosystemSupportedGames, Platform} from '../schema/ThunderstoreSchema';
import path from '../../providers/node/path/path';

const gameListRef: ComputedRef<Game[]> = computed(() =>
EcosystemSupportedGames.value.map(([identifier, game]) => new Game(
game.meta.displayName,
game.internalFolderName,
game.settingsIdentifier,
game.steamFolderName,
game.exeNames,
game.dataFolderName,
game.packageIndex,
identifier,
game.distributions.map(
(x) => new StorePlatformMetadata(x.platform, x.identifier || undefined)
),
game.meta.iconUrl ?? "",
game.gameSelectionDisplayMode,
game.gameInstanceType,
game.packageLoader,
game.additionalSearchStrings,
))
);

export default class GameManager {

private static _activeGame: Game;
Expand All @@ -23,24 +45,7 @@ export default class GameManager {
}

static get gameList(): Game[] {
return EcosystemSupportedGames.value.map(([identifier, game]) => new Game(
game.meta.displayName,
game.internalFolderName,
game.settingsIdentifier,
game.steamFolderName,
game.exeNames,
game.dataFolderName,
game.packageIndex,
identifier,
game.distributions.map(
(x) => new StorePlatformMetadata(x.platform, x.identifier || undefined)
),
game.meta.iconUrl ?? "",
game.gameSelectionDisplayMode,
game.gameInstanceType,
game.packageLoader,
game.additionalSearchStrings,
));
return gameListRef.value;
}

public static async activate(game: Game, platform: Platform) {
Expand Down
Loading