protected override void Update()
 {
     gm.HandleResultAnalysis();
     if (gm.IsEndOfExperiment()) // Experiment end
     {
         gm.HudManager.DisplayText("Experiment end. Thank you!", 6.0f);
         //nextRequest = NextStateRequest.End;
         nextState  = new End(gm);
         stateStage = EVENT.EXIT;
     }
     else if (gm.IsEndOfSession()) // End session and start a new one
     {
         gm.SetWaitFlag(3.0f);
         //nextRequest = NextStateRequest.Next;
         nextState  = new InitialisingNextSession(gm);
         stateStage = EVENT.EXIT;
     }
     else if (gm.IsRestTime()) // Rest time
     {
         gm.HudManager.DisplayText("Take a " + gm.RestTime + " seconds rest.", 6.0f);
         gm.SetWaitFlag(gm.RestTime);
         //nextRequest = NextStateRequest.Rest;
         nextState  = new Resting(gm);
         stateStage = EVENT.EXIT;
     }
     else // Continue with next iteration
     {
         gm.SetWaitFlag(3.0f);
         //nextRequest = NextStateRequest.Continue;
         nextState  = new InitialisingNextIteration(gm);
         stateStage = EVENT.EXIT;
     }
 }
Ejemplo n.º 2
0
        protected override void Update()
        {
            // Continuously display status to user
            gm.InstructionManager.DisplayText(gm.GetDisplayInfoText());

            // Check if experiment wants to skip to the next session or end the experiment.
            if (gm.UpdateNext())
            {
                nextState  = new InitialisingNextSession(gm);
                stateStage = EVENT.EXIT;
            }
            else if (gm.UpdateEnd())
            {
                nextState  = new End(gm);
                stateStage = EVENT.EXIT;
            }
            // Wait for the flag to be released to be able to initialise the next iteration
            else if (gm.WaitFlag)
            {
                gm.SetWaitFlag(5.0f);
                gm.HudManager.DisplayText("5 more seconds...", 3.0f);
                nextState  = new InitialisingNextIteration(gm);
                stateStage = EVENT.EXIT;
            }
        }