mirror of
https://github.com/tcgdex/cards-database.git
synced 2025-08-04 21:32:03 +00:00
Initial Database
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
59
interfaces/AbilityType.ts
Normal file
59
interfaces/AbilityType.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
enum AbilityType {
|
||||
POKEBODY,
|
||||
POKEPOWER,
|
||||
TALENT,
|
||||
ANCIENTTRAIT
|
||||
}
|
||||
|
||||
const en = [
|
||||
"Poké-Body",
|
||||
"Poké-Power",
|
||||
"Ability",
|
||||
"Ancient Trait"
|
||||
]
|
||||
|
||||
const fr = [
|
||||
"Poké-Body",
|
||||
"Poké-Power",
|
||||
"Talent",
|
||||
"Trait Ancien"
|
||||
]
|
||||
|
||||
namespace AbilityType {
|
||||
|
||||
export function toLang(a: AbilityType, lang: string): string {
|
||||
switch (lang) {
|
||||
case "en":
|
||||
return en[a]
|
||||
case "fr":
|
||||
return fr[a]
|
||||
}
|
||||
throw new Error(`Error , abilityType not translated! (${lang})`)
|
||||
}
|
||||
export function getFromText(txt: string): AbilityType {
|
||||
switch (txt) {
|
||||
case "Ability":
|
||||
|
||||
case "Talent":
|
||||
return AbilityType.TALENT
|
||||
|
||||
case "Poké-Body":
|
||||
case "Pok<6F><6B>-Body":
|
||||
return AbilityType.POKEBODY
|
||||
|
||||
case "Poké-Power":
|
||||
case "Pokémon Power":
|
||||
case "Pok<6F><6B>-Power":
|
||||
return AbilityType.POKEPOWER
|
||||
|
||||
case "Ancient Trait":
|
||||
|
||||
case "Trait Antique":
|
||||
return AbilityType.ANCIENTTRAIT
|
||||
default:
|
||||
throw new Error(`Ability Type (${txt}) not found!`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default AbilityType
|
Reference in New Issue
Block a user