MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / serialize

Method serialize

game/state/gamestate_serialize.cpp:469–484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

467}
468
469bool GameState::serialize(SerializationArchive *archive) const
470{
471 try
472 {
473 GameState defaultState;
474 auto root = archive->newRoot("", "gamestate");
475 root->addNode("serialization_version", GAMESTATE_SERIALIZATION_VERSION);
476 serializeOut(root, *this, defaultState);
477 }
478 catch (SerializationException &e)
479 {
480 LogError("Serialization failed: \"%s\"", e.what());
481 return false;
482 }
483 return true;
484}
485
486bool GameState::serialize(SerializationArchive *archive, const GameState &reference) const
487{

Callers 1

saveGameMethod · 0.80

Calls 3

newRootMethod · 0.80
addNodeMethod · 0.80
serializeOutFunction · 0.70

Tested by

no test coverage detected