public static ResponderStrategy GetStrategyForResponderType(PerformanceResponderType performanceResponderType)
 {
     if (!map.ContainsKey(performanceResponderType))
     {
         throw new Exception("ResponderTypeToStrategyMap does not contain an entry for PerformanceResponderType: " + performanceResponderType);
     }
     return(map[performanceResponderType]);
 }
Example #2
0
        public void RemoveResponder(PerformanceResponder performanceResponder)
        {
            PerformanceResponderType performanceResponderType = performanceResponder.GetPerformanceResponderType();

            if (performanceResponderTypeToResponders.ContainsKey(performanceResponderType))
            {
                performanceResponderTypeToResponders[performanceResponderType].Remove(performanceResponder);
            }
        }
Example #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);
        }