| 59 | } |
| 60 | |
| 61 | std::shared_future<void> SaveManager::loadSpecialSave(const SaveType type, |
| 62 | sp<GameState> state) const |
| 63 | { |
| 64 | if (type == SaveType::Manual) |
| 65 | { |
| 66 | LogError("Cannot load automatic save for type %i", static_cast<int>(type)); |
| 67 | return std::async(std::launch::deferred, []() -> void { return; }); |
| 68 | } |
| 69 | |
| 70 | UString saveName; |
| 71 | |
| 72 | try |
| 73 | { |
| 74 | saveName = saveTypeNames.at(type); |
| 75 | } |
| 76 | catch (std::out_of_range &) |
| 77 | { |
| 78 | LogError("Cannot find name of save type %i", static_cast<int>(type)); |
| 79 | return std::async(std::launch::deferred, []() -> void { return; }); |
| 80 | } |
| 81 | |
| 82 | return loadGame(createSavePath(saveName), state); |
| 83 | } |
| 84 | |
| 85 | bool writeArchiveWithBackup(SerializationArchive *archive, const UString &path, bool pack) |
| 86 | { |
nothing calls this directly
no test coverage detected