| | 1 | | using System; |
| | 2 | | using System.Collections.Generic; |
| | 3 | |
|
| | 4 | | namespace DCL |
| | 5 | | { |
| | 6 | | public class PluginGroup |
| | 7 | | { |
| 12 | 8 | | public Dictionary<Type, PluginInfo> plugins = new Dictionary<Type, PluginInfo>(); |
| | 9 | |
|
| | 10 | | public bool Add(Type type, PluginInfo pluginInfo) |
| | 11 | | { |
| 19 | 12 | | if ( plugins.ContainsKey(type) ) |
| 0 | 13 | | return false; |
| | 14 | |
|
| 19 | 15 | | plugins.Add(type, pluginInfo); |
| 19 | 16 | | return true; |
| | 17 | | } |
| | 18 | |
|
| | 19 | | public bool Remove(Type type) |
| | 20 | | { |
| 1 | 21 | | if ( !plugins.ContainsKey(type)) |
| 0 | 22 | | return false; |
| | 23 | |
|
| 1 | 24 | | plugins.Remove(type); |
| 1 | 25 | | return true; |
| | 26 | | } |
| | 27 | |
|
| | 28 | | public bool ContainsKey(Type type) |
| | 29 | | { |
| 11 | 30 | | return plugins.ContainsKey(type); |
| | 31 | | } |
| | 32 | | } |
| | 33 | | } |