예제 #1
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));
        }
예제 #2
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);
        }