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]); }
public void RemoveResponder(PerformanceResponder performanceResponder) { PerformanceResponderType performanceResponderType = performanceResponder.GetPerformanceResponderType(); if (performanceResponderTypeToResponders.ContainsKey(performanceResponderType)) { performanceResponderTypeToResponders[performanceResponderType].Remove(performanceResponder); } }
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); }