import { DuelsStat } from '@firestone-hs/duels-global-stats/dist/stat' ; import { DuelsLeaderboard } from '@firestone-hs/duels-leaderboard' ; import { DuelsRewardsInfo } from '@firestone-hs/retrieve-users-duels-runs/dist/duels-rewards-info' ; import { DuelsRunInfo } from '@firestone-hs/retrieve-users-duels-runs/dist/duels-run-info' ; import { DuelsCategory } from '../mainwindow/duels/duels-category' ; import { PatchInfo } from '../patches' ; import { DuelsGroupedDecks } from './duels-grouped-decks' ; import { DuelsDeckSummary } from './duels-personal-deck' ; import { DuelsDeckStat } from './duels-player-stats' ; import { DuelsRun } from './duels-run' ; export class DuelsState { readonly loading : boolean = true ; readonly categories : readonly DuelsCategory [ ] ; readonly duelsRunInfos : readonly DuelsRunInfo [ ] ; readonly duelsRewardsInfo : readonly DuelsRewardsInfo [ ] ; readonly runs : readonly DuelsRun [ ] ; readonly globalStats : DuelsStat ; readonly topDecks : readonly DuelsGroupedDecks [ ] = [ ] ; readonly personalDeckStats : readonly DuelsDeckSummary [ ] = [ ] ; readonly leaderboard : DuelsLeaderboard ; readonly additionalDeckDetails : readonly DuelsDeckStat [ ] = [ ] ; readonly currentDuelsMetaPatch : PatchInfo ; public static create ( base ) { return Object . assign ( new DuelsState ( ) , base ) ; } public update ( base ) { return Object . assign ( new DuelsState ( ) , this , base ) ; } public findCategory ( categoryId ) { const result = this . categories ?. find ( ( cat ) => cat . id === categoryId ) ; return result ; } }