Axiom.Components.Paging.PagedWorldSection.Load C# (CSharp) Method

Load() public method

Load this section from a stream (returns true if successful)
public Load ( StreamSerializer stream ) : bool
stream Axiom.Serialization.StreamSerializer
return bool
        public virtual bool Load(StreamSerializer stream)
        {
            if (stream.ReadChunkBegin(CHUNK_ID, CHUNK_VERSION, "PagedWorldSection") == null)
                return false;

            //name
            stream.Read(out mName);
            // AABB
            stream.Read(out mAABB);
            //page strategy name
            string stratName = string.Empty;
            stream.Read(out stratName);
            SetStrategy(stratName);
            //page strategy data
            bool strategyDataOk = mStrategyData.Load(stream);
            if (!strategyDataOk)
                LogManager.Instance.Write("Error: PageStrategyData for section '" +
                    mName + "' was not loaded correctly, check file contens");

            stream.ReadChunkEnd(CHUNK_ID);

            return true;
        }
        /// <summary>

Usage Example

Exemplo n.º 1
0
        public bool Load(StreamSerializer stream)
        {
            if (stream.ReadChunkBegin(CHUNK_ID, CHUNK_VERSION, "PageWorld") == null)
            {
                return(false);
            }

            //name
            stream.Read(out this.mName);
            //sections
            while (stream.NextChunkId == PagedWorld.CHUNK_SECTIONDECLARATION_ID)
            {
                stream.ReadChunkBegin();
                string sectionType, sectionName;
                stream.Read(out sectionType);
                stream.Read(out sectionName);
                stream.ReadChunkEnd(CHUNK_SECTIONDECLARATION_ID);
                // Scene manager will be loaded
                PagedWorldSection sec = CreateSection(null, sectionType, sectionName);
                bool sectionOk        = sec.Load(stream);
                if (!sectionOk)
                {
                    DestroySection(sec);
                }
            }

            stream.ReadChunkEnd(CHUNK_ID);

            return(true);
        }
All Usage Examples Of Axiom.Components.Paging.PagedWorldSection::Load