1
0
mirror of https://github.com/tcgdex/cards-database.git synced 2025-07-30 03:29:51 +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

247
interfaces/Tag.ts Normal file
View File

@ -0,0 +1,247 @@
enum Tag {
BASIC,
BASICENERGY,
BREAK,
EX,
GX,
ITEM,
LEGEND,
LEVELUP,
MEGA,
RESTORED,
ROCKETSECRETMACHINE,
SP, // not in switch case
SPECIAL,
STADIUM,
STAGE1,
STAGE2,
SUPPORTER,
TAGTEAM,
TECHNICALMACHINE,
TOOL,
V,
VMAX,
}
const en = [
"Basic Pokémon",
"Basic Energy",
"BREAK",
"EX",
"GX",
"Item",
"LEGEND",
"Level-Up",
"MEGA",
"Restored",
"Rocket's Secret Machine",
"SP",
"Special",
"Stadium",
"Stage 1",
"Stage 2",
"Supporter",
"Tag Team",
"Technical Machine",
"Tool",
"Pokémon V",
"Pokémon VMAX"
]
const fr = [
"Pokémon de base",
"Energie de base",
"TURBO",
"EX",
"GX",
"Objet",
"LÉGENDE",
"Niveau Sup",
"Méga",
"Restauré",
"Machine secrète dees Rocket",
"SP",
"Spéciale",
"Stadium",
"Niveau 1",
"Niveau 2",
"Supporter",
"ESCOUADE",
"Machine Technique",
"Outil",
"Pokémon V",
"Pokémon VMAX"
]
namespace Tag {
export function toLang(i: Tag, lang: string) {
switch (lang) {
case "en":
return en[i]
case "fr":
return fr[i]
default:
break;
}
}
export function lookup(str: string): Array<Tag> {
const list: Array<Tag> = []
switch (str) {
// BASIC
case "Basic Pokémon":
case "Basic":
case "Pokémon de base":
list.push(Tag.BASIC)
break
case "Basic Energy":
case "Énergie de base":
list.push(Tag.BASICENERGY)
break
// BREAK
case "BREAK":
case "TURBO":
list.push(Tag.BREAK)
break
// EX
case "Pokémon-EX":
case "EX":
case "EX Pokémon":
list.push(Tag.EX)
break
// GX
case "Pokémon-GX":
case "GX":
list.push(Tag.GX)
break
// Item
case "Trainer - Item":
case "Item":
case "Dresseur - Object":
list.push(Tag.ITEM)
break
// LEGEND
case "Pokémon LEGEND":
case "LEGEND":
case "Pokémon Légende":
list.push(Tag.LEGEND)
break
// Level-Up
case "Level-Up Pokémon":
case "Level Up":
case "Niveau Sup. Pokémon":
list.push(Tag.LEVELUP)
break
// MEGA
case "MEGA":
case "Méga-":
list.push(Tag.MEGA)
break
// Restored
case "Restored Pokémon":
case "Restored":
list.push(Tag.RESTORED)
break
// Rocket's Secret Machine
case "Trainer [Rocket's Secret Machine]":
case "Rocket's Secret Machine":
list.push(Tag.ROCKETSECRETMACHINE)
break
case "Special Energy":
case "Special":
case "Énergie spéciale":
list.push(Tag.SPECIAL)
break
case "Trainer - Stadium":
case "Trainer [Stadium]":
case "Stadium":
case "Dresseur - Stade":
list.push(Tag.STADIUM)
break
// Stage 1
case "Stage 1 Pokémon":
case "Stage 1":
case "Pokémon Niveau 1":
list.push(Tag.STAGE1)
break
// Stage 2
case "Stage 2 Pokémon":
case "Stage 2":
case "Pokémon Niveau 2":
list.push(Tag.STAGE2)
break
// Supporter
case "Trainer - Supporter":
case "Trainer [Supporter]":
case "Supporter":
case "Dresseur - Supporter":
list.push(Tag.SUPPORTER)
break
// TAG TEAM
case "Pokémon-TAG TEAM":
case "TAG TEAM":
case "Pokémon-ESCOUADE":
list.push(Tag.TAGTEAM)
break
case "Trainer [Technical Machine]":
case "Technical Machine":
case "Machine Technique":
list.push(Tag.TECHNICALMACHINE)
break
case "Trainer [Pokémon Tool]":
case "Pokémon Tool":
case "Pok<6F><6B>mon Tool":
case "Dresseur [Outil Pokémon]":
list.push(Tag.TOOL)
break
case "Pokémon-V":
list.push(Tag.V)
break
case "Pokémon-VMAX":
list.push(Tag.VMAX)
case "null":
break
default:
throw new Error(`Tag is not corresponding to anything (${str})`);
}
return list
}
}
export default Tag