Changeset View
Changeset View
Standalone View
Standalone View
source/ps/SavedGame.h
/* Copyright (C) 2021 Wildfire Games. | /* Copyright (C) 2022 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | namespace SavedGames | ||||
/** | /** | ||||
* Permanently deletes the saved game archive with the given name | * Permanently deletes the saved game archive with the given name | ||||
* | * | ||||
* @param name filename of saved game (without path or extension) | * @param name filename of saved game (without path or extension) | ||||
* @return true if deletion was successful, or false on error | * @return true if deletion was successful, or false on error | ||||
*/ | */ | ||||
bool DeleteSavedGame(const std::wstring& name); | bool DeleteSavedGame(const std::wstring& name); | ||||
/** | |||||
* Create new saved game archive with "quicksave" name and given simulation data | |||||
* | |||||
* @param simulation | |||||
* @param guiMetadataClone if not NULL, store some UI-related data with the saved game | |||||
* @return INFO::OK if successfully saved, else an error Status | |||||
*/ | |||||
Status QuickSave(CSimulation2& simulation, const Script::StructuredClone& guiMetadataClone); | |||||
/** | |||||
* Load saved game with "quicksave" name | |||||
* | |||||
* Reads the matchID property from the game metadata of "quicksave" saved game archive. | |||||
* Proceeds to load the saved game, if said matchID is equal to the matchID of the given | |||||
* simulation object reference. | |||||
* | |||||
* @param simulation | |||||
* @return INFO::OK if successfully loaded, else another info or error Status | |||||
*/ | |||||
Status QuickLoad(CSimulation2& simulation); | |||||
} | } | ||||
#endif // INCLUDED_SAVEDGAME | #endif // INCLUDED_SAVEDGAME |
Wildfire Games · Phabricator