| 378 | GLOGChunkHandler() : ChunkHandler('GLOG', CH_TABLE) {} |
| 379 | |
| 380 | void LoadCommon(Gamelog &gamelog) const |
| 381 | { |
| 382 | assert(gamelog.data->action.empty()); |
| 383 | |
| 384 | const std::vector<SaveLoad> slt = SlCompatTableHeader(_gamelog_desc, _gamelog_sl_compat); |
| 385 | |
| 386 | if (IsSavegameVersionBefore(SLV_RIFF_TO_ARRAY)) { |
| 387 | uint8_t type; |
| 388 | while ((type = SlReadByte()) != GLAT_NONE) { |
| 389 | if (type >= GLAT_END) SlErrorCorrupt("Invalid gamelog action type"); |
| 390 | |
| 391 | LoggedAction &la = gamelog.data->action.emplace_back(); |
| 392 | la.at = (GamelogActionType)type; |
| 393 | SlObject(&la, slt); |
| 394 | } |
| 395 | return; |
| 396 | } |
| 397 | |
| 398 | while (SlIterateArray() != -1) { |
| 399 | LoggedAction &la = gamelog.data->action.emplace_back(); |
| 400 | SlObject(&la, slt); |
| 401 | } |
| 402 | } |
| 403 | |
| 404 | void Save() const override |
| 405 | { |
no test coverage detected