Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/ps/SavedGame.h
/* Copyright (C) 2018 Wildfire Games. | /* Copyright (C) 2020 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 All 30 Lines | namespace SavedGames | ||||
* Create new saved game archive with given name and simulation data | * Create new saved game archive with given name and simulation data | ||||
* | * | ||||
* @param name Name to save the game with | * @param name Name to save the game with | ||||
* @param description A user-given description of the save | * @param description A user-given description of the save | ||||
* @param simulation | * @param simulation | ||||
* @param guiMetadataClone if not NULL, store some UI-related data with the saved game | * @param guiMetadataClone if not NULL, store some UI-related data with the saved game | ||||
* @return INFO::OK if successfully saved, else an error Status | * @return INFO::OK if successfully saved, else an error Status | ||||
*/ | */ | ||||
Status Save(const CStrW& name, const CStrW& description, CSimulation2& simulation, const shared_ptr<ScriptInterface::StructuredClone>& guiMetadataClone); | Status Save(const CStrW& name, const CStrW& description, CSimulation2& simulation, const ScriptInterface::StructuredClone& guiMetadataClone); | ||||
/** | /** | ||||
* Create new saved game archive with given prefix and simulation data | * Create new saved game archive with given prefix and simulation data | ||||
* | * | ||||
* @param prefix Create new numbered file starting with this prefix | * @param prefix Create new numbered file starting with this prefix | ||||
* @param description A user-given description of the save | * @param description A user-given description of the save | ||||
* @param simulation | * @param simulation | ||||
* @param guiMetadataClone if not NULL, store some UI-related data with the saved game | * @param guiMetadataClone if not NULL, store some UI-related data with the saved game | ||||
* @return INFO::OK if successfully saved, else an error Status | * @return INFO::OK if successfully saved, else an error Status | ||||
*/ | */ | ||||
Status SavePrefix(const CStrW& prefix, const CStrW& description, CSimulation2& simulation, const shared_ptr<ScriptInterface::StructuredClone>& guiMetadataClone); | Status SavePrefix(const CStrW& prefix, const CStrW& description, CSimulation2& simulation, const ScriptInterface::StructuredClone& guiMetadataClone); | ||||
/** | /** | ||||
* Load saved game archive with the given name | * Load 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) | ||||
* @param scriptInterface | * @param scriptInterface | ||||
* @param[out] metadata object containing metadata associated with saved game, | * @param[out] metadata object containing metadata associated with saved game, | ||||
* parsed from metadata.json inside the archive. | * parsed from metadata.json inside the archive. | ||||
Show All 24 Lines |
Wildfire Games · Phabricator