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);
}