Ejemplo n.º 1
0
 public void RemoveWorldSectionFactory(PagedWorldSectionFactory f)
 {
     if (this.mWorldSectionFactories.ContainsKey(f.Name))
     {
         this.mWorldSectionFactories.Remove(f.Name);
     }
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 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
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 6
0
		public void RemoveWorldSectionFactory( PagedWorldSectionFactory f )
		{
			if ( this.mWorldSectionFactories.ContainsKey( f.Name ) )
			{
				this.mWorldSectionFactories.Remove( f.Name );
			}
		}
Ejemplo n.º 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 );
		}