| 467 | } |
| 468 | |
| 469 | bool 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 | |
| 486 | bool GameState::serialize(SerializationArchive *archive, const GameState &reference) const |
| 487 | { |
no test coverage detected