public void HandleEvent(QuestionnaireEvents ev) { switch (GetState()) { case QuestionnaireStates.Idle: if (ev == QuestionnaireEvents.RoomOff) { ChangeState(QuestionnaireStates.Start); } break; case QuestionnaireStates.ShowQuestion: if (ev == QuestionnaireEvents.QuestionDisplayed) { ChangeState(QuestionnaireStates.WaitingForAnswer); } break; case QuestionnaireStates.WaitingForAnswer: if (ev == QuestionnaireEvents.QuestionAnswered) { ChangeState(QuestionnaireStates.Delay); } break; case QuestionnaireStates.Delay: break; case QuestionnaireStates.End: trialController.HandleEvent(TrialEvents.QuestionsFinished); break; } }
protected override void OnEnter(OwnershipTrialStates oldState) { switch (GetState()) { case OwnershipTrialStates.Idle: handSwitcher.showRightHand = true; break; case OwnershipTrialStates.ExperimentWave: waveController.StartMachine(); break; case OwnershipTrialStates.Threat: threatController.StartMachine(); threatDone = true; break; case OwnershipTrialStates.Interval: break; case OwnershipTrialStates.End: trialController.HandleEvent(TrialEvents.SpTrialFinished); this.StopMachine(); break; } }
protected override void OnEnter(AgencyTrialStates oldState) { switch (GetState()) { case AgencyTrialStates.Idle: handSwitcher.showRightHand = true; break; case AgencyTrialStates.PreMeasure: measure.SetActive(true); break; case AgencyTrialStates.ExperimentWave: waveController.StartMachine(); break; case AgencyTrialStates.PostMeasure: measure.SetActive(true); break; case AgencyTrialStates.End: // experimentController.HandleEvent(ExperimentEvents.TrialFinished); trialController.HandleEvent(TrialEvents.SpTrialFinished); this.StopMachine(); break; } }
protected override void OnEnter(VisuomotorAgencyStates oldState) { switch (GetState()) { case VisuomotorAgencyStates.Idle: handSwitcher.showRightHand = true; break; case VisuomotorAgencyStates.ExperimentWave: break; case VisuomotorAgencyStates.Threat: threatController.StartMachine(); threatController.HandleEvent(ThreatEvent.ReleaseThreat); break; case VisuomotorAgencyStates.End: trialController.HandleEvent(TrialEvents.SpTrialFinished); this.StopMachine(); break; } }
protected override void OnEnter(RepeatThreatStates oldState) { switch (GetState()) { case RepeatThreatStates.Idle: handSwitcher.showRightHand = true; break; case RepeatThreatStates.ExperimentWave: break; case RepeatThreatStates.Threat: threatController.threat.SetActive(true); break; case RepeatThreatStates.End: trialController.HandleEvent(TrialEvents.SpTrialFinished); this.StopMachine(); break; } }