// effects: associates the filter creator function with name // replaces the existing creator if one exists public void RegisterFilter(string name, Filter.CreateFn fn) { if (_filters.ContainsKey(name)) { throw new Exception($"{name} already registered"); } _filters[name] = fn; }
// effects: associates the filter creator function with name // replaces the existing creator if one exists public void RegisterFilter(string name, Filter.CreateFn fn) { if (_filters.ContainsKey(name) == true) { _filters[name] = fn; } else { _filters.Add(name, fn); } }
// Wrapper function for FilterFactory.RegisterFilter public void RegisterFilter(string name, Filter.CreateFn fn) { _filters.RegisterFilter(name, fn); }