import { GameType } from '@firestone-hs/reference-data' ; import { GameEvent } from '../../../../../../models/game-event' ; import { RealTimeStatsState } from '../../real-time-stats' ; import { EventParser } from '../_event-parser' ; export class RTStatBgsEnemyHeroKilledParser implements EventParser { applies ( gameEvent , currentState ) { return ( [ GameType . GT_BATTLEGROUNDS , GameType . GT_BATTLEGROUNDS_FRIENDLY ] . includes ( currentState . gameType ) && gameEvent . type === GameEvent . BATTLEGROUNDS_ENEMY_HERO_KILLED ) ; } parse ( gameEvent , currentState ) { return currentState . update ( { totalEnemyHeroesKilled : currentState . totalEnemyHeroesKilled + 1 , } as RealTimeStatsState ) ; } name ( ) { return 'RTStatBgsEnemyHeroKilledParser' ; } }