import { GameState } from '../../../models/decktracker/game-state' ; import { GameEvent } from '../../../models/game-event' ; import { EventParser } from './event-parser' ; export class MainStepReadyParser implements EventParser { applies ( gameEvent , state ) { return state && gameEvent . type === GameEvent . MAIN_STEP_READY ; } async parse ( currentState , gameEvent ) { if ( currentState . currentTurn !== 0 ) { return currentState ; } return Object . assign ( new GameState ( ) , currentState , { mulliganOver : true , currentTurn : 1 , } as GameState ) ; } event ( ) { return GameEvent . MAIN_STEP_READY ; } }