예제 #1
0
 public void RemoveWorldSectionFactory(PagedWorldSectionFactory f)
 {
     if (this.mWorldSectionFactories.ContainsKey(f.Name))
     {
         this.mWorldSectionFactories.Remove(f.Name);
     }
 }
예제 #2
0
        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);
        }
예제 #3
0
        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));
        }
예제 #4
0
        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
            }
        }
예제 #5
0
        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);
        }
예제 #6
0
		public void RemoveWorldSectionFactory( PagedWorldSectionFactory f )
		{
			if ( this.mWorldSectionFactories.ContainsKey( f.Name ) )
			{
				this.mWorldSectionFactories.Remove( f.Name );
			}
		}
예제 #7
0
		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 );
		}