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

Method loadSpecialSave

game/state/savemanager.cpp:61–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61std::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
85bool writeArchiveWithBackup(SerializationArchive *archive, const UString &path, bool pack)
86{

Callers

nothing calls this directly

Calls 1

loadGameFunction · 0.85

Tested by

no test coverage detected