public float GetNormalizedScoreForResponder(FrameData frameData, PerformanceResponder performanceResponder, float maxNormalizedScore)
 {
     if (performanceResponder.GetPerformanceResponderType() != getExpectedResponseType())
     {
         throw new ArgumentException(string.Concat("Expected PerformanceResponseType of ", getExpectedResponseType(), ", but got PerformanceResponder of type ", performanceResponder.GetPerformanceResponderType()));
     }
     return(evaluateScore(frameData, performanceResponder, maxNormalizedScore));
 }
Beispiel #2
0
        public void RemoveResponder(PerformanceResponder performanceResponder)
        {
            PerformanceResponderType performanceResponderType = performanceResponder.GetPerformanceResponderType();

            if (performanceResponderTypeToResponders.ContainsKey(performanceResponderType))
            {
                performanceResponderTypeToResponders[performanceResponderType].Remove(performanceResponder);
            }
        }
Beispiel #3
0
        public float AddResponder(PerformanceResponder performanceResponder)
        {
            PerformanceResponderType performanceResponderType = performanceResponder.GetPerformanceResponderType();

            if (!performanceResponderTypeToResponders.ContainsKey(performanceResponderType))
            {
                List <PerformanceResponder> list = new List <PerformanceResponder>();
                list.Add(performanceResponder);
                performanceResponderTypeToResponders.Add(performanceResponderType, list);
            }
            else if (!performanceResponderTypeToResponders[performanceResponderType].Contains(performanceResponder))
            {
                performanceResponderTypeToResponders[performanceResponderType].Add(performanceResponder);
            }
            return(1f);
        }
Beispiel #4
0
        protected override float evaluateScore(FrameData frameData, PerformanceResponder performanceResponder, float maxNormalizedScore)
        {
            float num       = 0f;
            float magnitude = (Camera.main.transform.position - performanceResponder.TransformRef.position).magnitude;

            if (magnitude <= 5f)
            {
                return(maxNormalizedScore);
            }
            if (magnitude >= 10f)
            {
                return(0.5f);
            }
            float num2 = maxNormalizedScore - 0.5f;
            float num3 = (magnitude - 5f) / 5f;

            return(maxNormalizedScore - num3 * num2);
        }
 protected abstract float evaluateScore(FrameData frameData, PerformanceResponder performanceResponder, float maxNormalizedScore);