コード例 #1
0
 /// <summary>
 /// Get currently active trial. When not in a trial, gets previous trial.
 /// </summary>
 /// <returns>Currently active trial.</returns>
 public Trial GetTrial()
 {
     if (currentTrialNum == 0)
     {
         throw new NoSuchTrialException("There is no trial zero. Did you try to perform operations on the current trial before the first one started? If you are the start of the experiment please use NextTrial to get the first trial. ");
     }
     return(Trials.ToList()[currentTrialNum - 1]);
 }
コード例 #2
0
ファイル: Session.cs プロジェクト: rubtuc/unity-vr-fire
 /// <summary>
 /// Get currently active trial. When not in a trial, gets previous trial.
 /// </summary>
 /// <returns>Currently active trial.</returns>
 public Trial GetTrial()
 {
     if (currentTrialNum == 0)
     {
         throw new NoSuchTrialException("There is no trial zero. If you are the start of the experiment please use nextTrial to get the first trial");
     }
     return(Trials.ToList()[currentTrialNum - 1]);
 }
コード例 #3
0
 /// <summary>
 /// Get previous Trial.
 /// </summary>
 /// <returns></returns>
 Trial GetPrevTrial()
 {
     try
     {
         // non zero indexed
         return(Trials.ToList()[currentTrialNum - 2]);
     }
     catch (ArgumentOutOfRangeException)
     {
         throw new NoSuchTrialException("There is no previous trial. Probably, currently at the start of session.");
     }
 }
コード例 #4
0
 /// <summary>
 /// Get next Trial
 /// </summary>
 /// <returns></returns>
 Trial GetNextTrial()
 {
     // non zero indexed
     try
     {
         return(Trials.ToList()[currentTrialNum]);
     }
     catch (ArgumentOutOfRangeException)
     {
         throw new NoSuchTrialException("There is no next trial. Reached the end of trial list. If you are at the start of the session, perhaps you tried to start the next trial before generating your trials? If you are at the end, you can use BeginNextTrialSafe to do nothing if there is no next trial.");
     }
 }
コード例 #5
0
ファイル: Session.cs プロジェクト: rubtuc/unity-vr-fire
 /// <summary>
 /// Get next Trial
 /// </summary>
 /// <returns></returns>
 Trial GetNextTrial()
 {
     // non zero indexed
     try
     {
         return(Trials.ToList()[currentTrialNum]);
     }
     catch (ArgumentOutOfRangeException)
     {
         throw new NoSuchTrialException("There is no next trial. Reached the end of trial list.");
     }
 }
コード例 #6
0
 /// <summary>
 /// Get trial by trial number (non zero indexed)
 /// </summary>
 /// <returns></returns>
 public Trial GetTrial(int trialNumber)
 {
     return(Trials.ToList()[trialNumber - 1]);
 }