public void RemoveWorldSectionFactory(PagedWorldSectionFactory f) { if (this.mWorldSectionFactories.ContainsKey(f.Name)) { this.mWorldSectionFactories.Remove(f.Name); } }
public void AddWorldSectionFactory(PagedWorldSectionFactory f) { // note - deliberately allowing overriding if (this.mWorldSectionFactories.ContainsKey(f.Name)) { this.mWorldSectionFactories[f.Name] = f; return; } this.mWorldSectionFactories.Add(f.Name, f); }
public PagedWorldSection CreateWorldSection(string typeName, string name, PagedWorld parent, SceneManager sm) { PagedWorldSectionFactory fact = GetWorldSectionFactory(typeName); if (fact == null) { throw new AxiomException("{0} is not the name of a valid PagedWorldSectionFactory PageManager.CreateWorldSection", typeName); } return(fact.CreateInstance(name, parent, sm)); }
public void DestroyWorldSection(ref PagedWorldSection coll) { PagedWorldSectionFactory fact = GetWorldSectionFactory(coll.Type); if (fact != null) { fact.DestroyInstance(ref coll); } else { coll.SafeDispose(); // normally a safe fallback } }
public PagedWorldSection CreateSection(SceneManager sceneMgr, string typeName, string sectionName) { var theName = sectionName; if (theName == string.Empty) { do { theName = this.mSectionNameGenerator.GetNextUniqueName(); }while (this.mSections.ContainsKey(theName)); } else if (this.mSections.ContainsKey(theName)) { throw new AxiomException("World section named '{0}' already exists! PagedWorld.CreateSection", theName); } PagedWorldSection ret = null; if (typeName == "General") { ret = new PagedWorldSection(theName, this, sceneMgr); } else { PagedWorldSectionFactory fact = this.mManager.GetWorldSectionFactory(typeName); if (fact == null) { throw new AxiomException("World section type '{0}' does not exist! PagedWorld::createSection", typeName); } ret = fact.CreateInstance(theName, this, sceneMgr); } this.mSections.Add(theName, ret); return(ret); }
public void RemoveWorldSectionFactory( PagedWorldSectionFactory f ) { if ( this.mWorldSectionFactories.ContainsKey( f.Name ) ) { this.mWorldSectionFactories.Remove( f.Name ); } }
public void AddWorldSectionFactory( PagedWorldSectionFactory f ) { // note - deliberately allowing overriding if ( this.mWorldSectionFactories.ContainsKey( f.Name ) ) { this.mWorldSectionFactories[ f.Name ] = f; return; } this.mWorldSectionFactories.Add( f.Name, f ); }