public IStoryCommandFactory FindFactory(StoryCommandGroupDefine group, string type) { IStoryCommandFactory factory = null; lock (m_Lock) { int ix = (int)group; if (ix >= 0 && ix < c_MaxCommandGroupNum) { Dictionary <string, IStoryCommandFactory> factories = m_GroupedCommandFactories[ix]; factories.TryGetValue(type, out factory); } } return(factory); }
public void RegisterCommandFactory(StoryCommandGroupDefine group, string type, IStoryCommandFactory factory, bool replace) { lock (m_Lock) { int ix = (int)group; if (ix >= 0 && ix < c_MaxCommandGroupNum) { Dictionary <string, IStoryCommandFactory> factories = m_GroupedCommandFactories[ix]; if (!factories.ContainsKey(type)) { factories.Add(type, factory); } else if (replace) { factories[type] = factory; } else { //error } } } }
public void RegisterCommandFactory(StoryCommandGroupDefine group, string type, IStoryCommandFactory factory) { RegisterCommandFactory(group, type, factory, false); }
public void RegisterCommandFactory(StoryCommandGroupDefine group, string type, IStoryCommandFactory factory, bool replace) { lock (m_Lock) { int ix = (int)group; if (ix >= 0 && ix < c_MaxCommandGroupNum) { Dictionary<string, IStoryCommandFactory> factories = m_GroupedCommandFactories[ix]; if (!factories.ContainsKey(type)) { factories.Add(type, factory); } else if (replace) { factories[type] = factory; } else { //error } } } }
public void RegisterCommandFactory(StoryCommandGroupDefine group, string type, IStoryCommandFactory factory) { RegisterCommandFactory(group, type, factory, false); }
public IStoryCommandFactory FindFactory(StoryCommandGroupDefine group, string type) { IStoryCommandFactory factory = null; lock (m_Lock) { int ix = (int)group; if (ix >= 0 && ix < c_MaxCommandGroupNum) { Dictionary<string, IStoryCommandFactory> factories = m_GroupedCommandFactories[ix]; factories.TryGetValue(type, out factory); } } return factory; }