//Helper functions start
        //---------------------------------------------------------
        //---------------------------------------------------------

        /// <summary>
        /// MeasureAllGames is called when all games end. It will call methods of
        /// evaluating scores for all abilities.
        /// </summary>
        private static void MeasureAllGames()
        {
            // Measure abilities for Balloons
            // If the game has been played, do the measurement; else don't do the measurement
            if (!notYetPlayBalloons)
            {
                PointingMeasure.EvaluateBalloonsScore();
                SelectiveVisualMeasure.EvaluateBalloonsScore();
                InhibitionMeasure.EvaluateBalloonsScore();
            }

            // Measure abilities for Squares
            // If the game has been played, do the measurement; else don't do the measurement
            if (!notYetPlaySquares)
            {
                SelectiveVisualMeasure.EvaluateSquaresScore();
                VisuospatialSketchpadMeasure.EvaluateSquaresScore();
            }

            // Measure abilities for Catch The Thief
            // If the game has been played, do the measurement; else don't do the measurement
            if (!notYetPlayCTF)
            {
                InhibitionMeasure.EvaluateCTFScore();
                SelectiveVisualMeasure.EvaluateCTFScore();
            }

            // Measure abilities for ImageHit
            // If the game has been played, do the measurement; else don't do the measurement
            if (!notYetPlayImageHit)
            {
                ObjectRecognitionMeasure.EvaluateImageHitScore();
                InhibitionMeasure.EvaluateImageHitScore();
                SelectiveVisualMeasure.EvaluateImageHitScore();
            }

            // Measure abilities for Catch The Ball
            // If the game has been played, do the measurement; else don't do the measurement
            if (!notYetCatchTheBall)
            {
                TimeToContact.EvaluateCatchTheBallScore();
            }

            // Measure abilities for Save One Ball
            // If the game has been played, do the measurement; else don't do the measurement
            if (!notYetSaveOneBall)
            {
                TimeToContact.EvaluateSaveOneBallScore();
            }

            // Measure abilities for Judge The Ball
            // If the game has been played, do the measurement; else don't do the measurement
            if (!notYetJudgeTheBall)
            {
                TimeToContact.EvaluateJudgeTheBallScore();
            }
        }
Пример #2
0
            public IEnumerator WHEN_EvaluateSquaresScoreFunctionCalled_SquaresSubScoreDerived()
            {
                ClearSelectiveVisualMeasure();

                // Call tested function
                SelectiveVisualMeasure.EvaluateSquaresScore();

                yield return(null);

                Assert.AreEqual(AbilityName.SELECTIVE_VISUAL, SelectiveVisualMeasure.subScoreSquares.AbilityName);
                Assert.AreEqual(GameName.SQUARES, SelectiveVisualMeasure.subScoreSquares.GameName);
                Assert.AreEqual(0, SelectiveVisualMeasure.subScoreSquares.Score);
                Assert.AreEqual(1, SelectiveVisualMeasure.subScoreSquares.Weight);
            }
Пример #3
0
            public IEnumerator WHEN_TestSquaresScore_NoRoundsReturn0()
            {
                int expectedScore = 0;
                int actualScore;

                // Score for round without mismatch
                ClearSelectiveVisualMeasure();
                SelectiveVisualMeasure.EvaluateSquaresScore();
                actualScore = VisuospatialSketchpadMeasure.subScoreSquares.Score;

                yield return(null);

                Assert.IsTrue(expectedScore == actualScore);
            }
Пример #4
0
            public IEnumerator WHEN_TestSquaresScore_DifferentOrderAndSameOrderHaveSameScore()
            {
                int scoreWithSameOrder;
                int scoreWithDifferentOrder;

                // Score for round without mismatch
                ClearSelectiveVisualMeasure();
                SelectiveVisualMeasure.squaresData.Rounds.Add(squareRound_sameOrder);
                SelectiveVisualMeasure.EvaluateSquaresScore();
                scoreWithSameOrder = VisuospatialSketchpadMeasure.subScoreSquares.Score;

                // Score for round with mismatch
                ClearSelectiveVisualMeasure();
                SelectiveVisualMeasure.squaresData.Rounds.Add(squareRound_differentOrder);
                SelectiveVisualMeasure.EvaluateSquaresScore();
                scoreWithDifferentOrder = VisuospatialSketchpadMeasure.subScoreSquares.Score;

                yield return(null);

                Assert.IsTrue(scoreWithDifferentOrder == scoreWithSameOrder);
            }
Пример #5
0
            public IEnumerator WHEN_TestSquaresScore_Mismatch()
            {
                int scoreWithMisMatch;
                int scoreWithoutMisMatch;

                // Score for round without mismatch
                ClearSelectiveVisualMeasure();
                SelectiveVisualMeasure.squaresData.Rounds.Add(squareRound_sameOrder);
                SelectiveVisualMeasure.squaresData.Rounds.Add(squareRound_sameOrder);
                SelectiveVisualMeasure.EvaluateSquaresScore();
                scoreWithoutMisMatch = SelectiveVisualMeasure.subScoreSquares.Score;

                // Score for round with mismatch
                ClearSelectiveVisualMeasure();
                SelectiveVisualMeasure.squaresData.Rounds.Add(squareRound_sameOrder);
                SelectiveVisualMeasure.squaresData.Rounds.Add(squareRound_mismatch);
                SelectiveVisualMeasure.EvaluateSquaresScore();
                scoreWithMisMatch = SelectiveVisualMeasure.subScoreSquares.Score;

                yield return(null);

                Assert.IsTrue(scoreWithMisMatch < scoreWithoutMisMatch, "scoreWithMismatch: " + scoreWithMisMatch + " ScoreWithoutMisMatch: " + scoreWithMisMatch);
            }
Пример #6
0
            public IEnumerator WHEN_TestSquaresScore_Gap()
            {
                int scoreWithGap;
                int scoreWithoutGap;

                // Score for round without mismatch
                ClearSelectiveVisualMeasure();

                SelectiveVisualMeasure.squaresData.Rounds.Add(squareRound_sameOrder);
                SelectiveVisualMeasure.squaresData.Rounds.Add(squareRound_sameOrder);
                SelectiveVisualMeasure.EvaluateSquaresScore();
                scoreWithoutGap = SelectiveVisualMeasure.subScoreSquares.Score;

                // Score for round with mismatch
                ClearSelectiveVisualMeasure();
                SelectiveVisualMeasure.squaresData.Rounds.Add(squareRound_sameOrder);
                SelectiveVisualMeasure.squaresData.Rounds.Add(squareRound_gap);
                SelectiveVisualMeasure.EvaluateSquaresScore();
                scoreWithGap = SelectiveVisualMeasure.subScoreSquares.Score;

                yield return(null);

                Assert.IsTrue(scoreWithGap < scoreWithoutGap, "scoreWithGap: " + scoreWithGap + " ScoreWithoutGap: " + scoreWithoutGap);
            }