- added polyobject serializer.

- added sanity checks to prevent a savegame from being loaded with an incompatible map
- refactored a few things to simplify serialization.
- started work on main level serializer function.
This commit is contained in:
Christoph Oelckers 2016-09-20 09:11:13 +02:00
commit daf43f9d35
13 changed files with 221 additions and 200 deletions

View file

@ -534,6 +534,21 @@ FSerializer &FSerializer::StringPtr(const char *key, const char *&charptr)
return *this;
}
//==========================================================================
//
//
//
//==========================================================================
unsigned FSerializer::GetSize(const char *group)
{
if (isWriting()) return -1; // we do not know this when writing.
const rapidjson::Value &val = r->mDocObj[group];
if (!val.IsArray()) return -1;
return val.Size();
}
//==========================================================================
//
// Writes out all collected objects