import { SceneMode } from '@firestone-hs/reference-data' ; import { RawRequirement } from '../../../../models/achievement/raw-requirement' ; import { GameEvent } from '../../../../models/game-event' ; import { Requirement } from './_requirement' ; export class SceneChangedToGameReq implements Requirement { private sceneChanged : boolean ; public static create ( rawReq ) { return new SceneChangedToGameReq ( ) ; } reset ( ) { this . sceneChanged = undefined ; } afterAchievementCompletionReset ( ) { this . sceneChanged = undefined ; } isCompleted ( ) { return this . sceneChanged ; } test ( gameEvent ) { if ( gameEvent . type === GameEvent . SCENE_CHANGED_MINDVISION ) { this . handleEvent ( gameEvent ) ; } } private handleEvent ( gameEvent ) { if ( gameEvent . additionalData . scene === SceneMode . GAMEPLAY ) { this . sceneChanged = true ; } } }