compiler/endpoints/attackUtil.ts
Florian Bouillon 552e4b49fa
Initial Compiler
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
2020-03-10 13:02:02 +01:00

14 lines
465 B
TypeScript

import Attack from "../db/interfaces/Attack";
import { Langs } from "../db/interfaces/LangList";
import { attackSingle } from "./attacks/attack";
import Type from "../db/interfaces/Type";
export function attackToAttackSingle(attack: Attack, lang: Langs): attackSingle {
return {
name: attack.name[lang],
cost: attack.cost && attack.cost.map(el => Type.toLang(el, lang)),
text: attack.text && attack.text[lang],
damage: attack.damage && attack.damage
}
}