import { GameEvent } from '../../../../../models/game-event' ; import { RealTimeStatsState } from '../real-time-stats' ; import { EventParser } from './_event-parser' ; export class RTStatsGameStartParser implements EventParser { applies ( gameEvent , currentState ) { return gameEvent . type === GameEvent . GAME_START ; } parse ( gameEvent , currentState ) { if ( currentState ?. reconnectOngoing ) { return currentState ; } return new RealTimeStatsState ( ) ; } name ( ) { return 'RTStatsGameStartParser' ; } }