mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 12:57:28 +00:00
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
|
|
import Jax from 'App/Services/Jax'
|
||
|
|
import {
|
||
|
|
ChampionDTO,
|
||
|
|
ItemDTO,
|
||
|
|
PerkDTO,
|
||
|
|
PerkStyleDTO,
|
||
|
|
SummonerSpellDTO,
|
||
|
|
} from 'App/Services/Jax/src/Endpoints/CDragonEndpoint'
|
||
|
|
import RoleIdentificationService, {
|
||
|
|
ChampionsPlayRate,
|
||
|
|
} from 'App/Services/RoleIdentificationService'
|
||
|
|
|
||
|
|
export default abstract class MatchSerializer {
|
||
|
|
protected champions: ChampionDTO[]
|
||
|
|
protected items: ItemDTO[]
|
||
|
|
protected perks: PerkDTO[]
|
||
|
|
protected perkstyles: PerkStyleDTO[]
|
||
|
|
protected summonerSpells: SummonerSpellDTO[]
|
||
|
|
protected championRoles: ChampionsPlayRate
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get global Context with CDragon Data
|
||
|
|
*/
|
||
|
|
public async getContext() {
|
||
|
|
const items = await Jax.CDragon.items()
|
||
|
|
const champions = await Jax.CDragon.champions()
|
||
|
|
const perks = await Jax.CDragon.perks()
|
||
|
|
const perkstyles = await Jax.CDragon.perkstyles()
|
||
|
|
const summonerSpells = await Jax.CDragon.summonerSpells()
|
||
|
|
const championRoles = await RoleIdentificationService.pullData().catch(() => {})
|
||
|
|
|
||
|
|
this.champions = champions
|
||
|
|
this.items = items
|
||
|
|
this.perks = perks
|
||
|
|
this.perkstyles = perkstyles.styles
|
||
|
|
this.summonerSpells = summonerSpells
|
||
|
|
this.championRoles = championRoles as ChampionsPlayRate
|
||
|
|
}
|
||
|
|
}
|