/* Copyright (C) 2014 DaikonForge */
namespace DaikonForge.VoIP
{
using System.Collections.Generic;
///
/// Helper class for when you need a way to index voice controllers by some key
///
public class VoiceControllerKeyedCollection where T : VoiceControllerBase
{
protected static Dictionary voiceControllers = new Dictionary();
public static void RegisterVoiceController( K key, T controller )
{
voiceControllers.Add( key, controller );
}
public static void UnregisterVoiceController( K key )
{
voiceControllers.Remove( key );
}
public static T GetVoiceController( K key )
{
if( !voiceControllers.ContainsKey( key ) )
{
return null;
}
return voiceControllers[ key ];
}
}
}