1
0
mirror of https://github.com/tcgdex/cards-database.git synced 2025-07-30 11:30:46 +00:00

Initial Database

Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
2020-02-19 16:19:09 +01:00
commit be94e712b8
12302 changed files with 1142705 additions and 0 deletions

38
interfaces/Category.ts Normal file
View File

@ -0,0 +1,38 @@
enum Category {
POKEMON,
TRAINER,
ENERGY
}
const en = [
"Pokémon",
"Trainer",
"Energy"
]
const fr = [
"Pokémon",
"Dresseur",
"Énergie"
]
namespace Category {
export function fromEnglish(str: string) {
let i = en.indexOf(str)
if (str === "Pok<6F><6B>mon") i = 1
if (i < 0) throw new Error(`Cannot get the category (${str})`)
return i
}
export function toLang(i: Category, lang: string): string {
switch (lang) {
case "en":
return en[i]
case "fr":
return fr[i]
}
throw new Error(`Error, Language not implemented! (${lang})`)
}
}
export default Category