remove enum, replace with string-only method

This commit is contained in:
ppc
2024-09-03 17:06:19 +01:00
parent 9fe0dcc35c
commit 153d3ff7ad
7 changed files with 50 additions and 110 deletions
+16 -31
View File
@@ -1,37 +1,22 @@
export enum GameId {
/**
* Initial D The Arcade
*/
IDAC = "SDGT",
/**
* Chunithm (Paradise Lost)
*/
Chuni = "SDBT",
/**
* Chunithm NEW onwards
*/
Chusan = "SDHD",
ONGEKI = "SDDT",
maimaiDX = "SDEZ",
DivaFT = "SBZV"
}
export function getGameName(id: GameId) {
switch (id) {
case GameId.IDAC:
/**
* Get the game name from the game identifier (4-letter code)
* @param id
*/
export function getGameName(id: string): string | null {
switch (id?.toUpperCase()) {
case "SDGT":
return "Initial D The Arcade";
case GameId.Chuni:
case "SDHD":
case "SDBT":
return "CHUNITHM";
case GameId.Chusan:
return "CHUNITHM (Paradise Lost)";
case GameId.ONGEKI:
return "O.N.G.E.K.I";
case GameId.maimaiDX:
case "SDDT":
return "O.N.G.E.K.I.";
case "SDEZ":
return "maimai DX";
case GameId.DivaFT:
case "SBZV":
return "Project DIVA Future Tone";
default:
return null;
}
}