/// <summary>
        /// Calculates the overall score for each ability and adds it to the
        /// list of overall scores.
        /// </summary>
        public static void CalculateOverallScoreSeq()
        {
            //all abilities
            AbilityName[] abilityNames =
            {
                AbilityName.SELECTIVE_VISUAL,
                AbilityName.INHIBITION,
                AbilityName.VISUOSPATIAL_SKETCHPAD,
                AbilityName.POINTING,
                AbilityName.TIME_TO_CONTACT,
                AbilityName.OBJECT_RECOGNITION
            };

            foreach (AbilityName abilityName in abilityNames)
            {
                int          score = CalculateOverallScoreForOneAbility(abilityName);
                AbilityLevel level = EvaluateLevel(score);

                OverallScoreStorage overallScore = new OverallScoreStorage
                {
                    AbilityName = abilityName,
                    Score       = score,
                    Level       = level
                };

                overallScoreSeq.Add(overallScore);
            }
        }
Exemplo n.º 2
0
            public IEnumerator WHEN_LevelSet_THEN_LevelGetFunctionWorks()
            {
                testOverallScoreStorage       = new OverallScoreStorage();
                testOverallScoreStorage.Level = AbilityLevel.OK;
                AbilityLevel expectedAbilityLevel = AbilityLevel.OK;

                yield return(null);

                Assert.AreEqual(expectedAbilityLevel, testOverallScoreStorage.Level);
            }
            public IEnumerator WHEN_CalculateOverallScoreSeqFunctionCalled_THEN_OverallScoreSeqUpdated()
            {
                // Add example SubScoreStorage objects to subScoreSeq
                AbilityManagement.subScoreSeq.Add(inhibition_ctf);
                AbilityManagement.subScoreSeq.Add(inhibition_balloons);
                AbilityManagement.subScoreSeq.Add(pointing_balloons);

                // Call tested function
                AbilityManagement.CalculateOverallScoreSeq();

                // Expected overall score and level
                int          expectedOverallScore_Inhition = (int)Math.Ceiling((double)(89 * 2 + 65 * 1) / (2 + 1));
                int          expectedOverallScore_Pointing = (int)Math.Ceiling((double)(71 * 2) / (2));
                AbilityLevel expectedOverallLevel_Inhition = AbilityManagement.EvaluateLevel(expectedOverallScore_Inhition);
                AbilityLevel expectedOverallLevel_Pointing = AbilityManagement.EvaluateLevel(expectedOverallScore_Pointing);

                List <OverallScoreStorage> actualOverallScoreSeq = AbilityManagement.overallScoreSeq;

                yield return(null);

                // Test the actualOverallScoreSeq is as expected
                foreach (OverallScoreStorage overallScore in actualOverallScoreSeq)
                {
                    if (overallScore.AbilityName == AbilityName.INHIBITION)
                    {
                        Assert.AreEqual(expectedOverallScore_Inhition, overallScore.Score);
                        Assert.AreEqual(expectedOverallLevel_Inhition, overallScore.Level);
                    }
                    else if (overallScore.AbilityName == AbilityName.POINTING)
                    {
                        Assert.AreEqual(expectedOverallScore_Pointing, overallScore.Score);
                        Assert.AreEqual(expectedOverallLevel_Pointing, overallScore.Level);
                    }
                    else
                    {
                        Assert.AreEqual(-1, overallScore.Score);
                        Assert.AreEqual(AbilityLevel.NOT_KNOWN, overallScore.Level);
                    }
                }
            }
 protected WeaponAbilityBasis(AbilityLevel level)
     : base(level)
 {
 }
 public EquipmentAbilityBasis(AbilityLevel level)
     : base(level)
 {
     IsVisbleDescription = true;
 }
Exemplo n.º 6
0
 public ElementalSlayer(CharacterParameterBasis.Elemental elemental, AbilityLevel level)
     : base(level)
 {
     TargetElemental = elemental;
 }
Exemplo n.º 7
0
 public AbilityBasis(AbilityLevel level)
 {
     CurrentAbilityLevel = level;
 }
 protected ShieldAbilityBasis(AbilityLevel level)
     : base(level)
 {
 }