protected void OnViewUpdate(IExerciseViewUpdateVO vo) { if (vo is ITutorialTrigger) { _currentRoundTriggers.Add((ITutorialTrigger)vo); } }
public override void OnViewUpdate(IExerciseViewUpdateVO vo) { if (vo is FlashGlanceItemUnlockedVO || vo is FlashGlanceItemHiddenVO) { _model.RoundIndependentUpdate((IRoundIndependentVO)vo); } else { base.OnViewUpdate(vo); } }
public virtual void OnViewUpdate(IExerciseViewUpdateVO vo) { if (vo is IAnswerVO) { if (InputEnabled) { ResetTimeoutTimer(); InputEnabled = false; _model.EvaluateAnswer(HandleAnswerResult, vo as IAnswerVO, _tutorialManager.IsTutorialRunning); } } else if (vo is IFeedbackShownVO) { _logger.LogMessage(LogLevel.Informational, "Current round result: " + _model.CurrentRoundResult); if (_model.CurrentRoundResult != null && _model.CurrentRoundResult.RoundCompleted) { CurrentState = BaseStates.INIT; } else { CurrentState = BaseStates.INPUT; } } else if (vo is IRoundCreatedVO) { CurrentState = BaseStates.INPUT; } else if (vo as IRoundIndependentVO != null) { IRoundIndependentUpdateResultVO result = _model.RoundIndependentUpdate((IRoundIndependentVO)vo); _hud.Update(result.Updates.OfType <IExerciseHudVO>().ToList()); var terminatorTriggers = result.Updates.OfType <ITerminatorTrigger>(); foreach (var t in terminatorTriggers) { _terminator.HandelTermiantionTrigger(t); } _view.Update(result); } else if (vo.GetType() == typeof(StartMemorizeVO)) { CurrentState = BaseStates.MEMORIZE_STEP; } else if (vo.GetType() == typeof(StopMemorizeVO)) { OnMemorizeTimeoutComplete(); } else if (vo.GetType() == typeof(ExerciseStageTapedVO)) { _backgroundView.Tap((vo as ExerciseStageTapedVO).Position); } else if (vo is ShowScoreAnimationVO) { _hud.Update(new List <IExerciseHudVO>() { vo as IExerciseHudVO }); } else if (vo is ExerciseSettingsChangedVO) { // Notify Mediator about settings change. NotifyMediatorUpdate((ExerciseSettingsChangedVO)vo); } }
protected void NotifyUpdate(IExerciseViewUpdateVO vo) { OnUpdate?.Invoke(vo); }