Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
SavedGames Namespace Reference

Functions

Status Save (const std::wstring &name, const std::wstring &description, CSimulation2 &simulation, CGUIManager *gui, int playerID)
 Create new saved game archive with given name and simulation data. More...
 
Status SavePrefix (const std::wstring &prefix, const std::wstring &description, CSimulation2 &simulation, CGUIManager *gui, int playerID)
 Create new saved game archive with given prefix and simulation data. More...
 
Status Load (const std::wstring &name, ScriptInterface &scriptInterface, CScriptValRooted &metadata, std::string &savedState)
 Load saved game archive with the given name. More...
 
std::vector< CScriptValRootedGetSavedGames (ScriptInterface &scriptInterface)
 Get list of saved games for GUI script usage. More...
 
bool DeleteSavedGame (const std::wstring &name)
 Permanently deletes the saved game archive with the given name. More...
 

Function Documentation

bool SavedGames::DeleteSavedGame ( const std::wstring &  name)

Permanently deletes the saved game archive with the given name.

Parameters
namefilename of saved game (without path or extension)
Returns
true if deletion was successful, or false on error

Definition at line 224 of file SavedGame.cpp.

std::vector< CScriptValRooted > SavedGames::GetSavedGames ( ScriptInterface scriptInterface)

Get list of saved games for GUI script usage.

Parameters
scriptInterfacethe ScriptInterface in which to create the return data.
Returns
list of objects containing saved game data

Definition at line 175 of file SavedGame.cpp.

Status SavedGames::Load ( const std::wstring &  name,
ScriptInterface scriptInterface,
CScriptValRooted metadata,
std::string &  savedState 
)

Load saved game archive with the given name.

Parameters
namefilename of saved game (without path or extension)
scriptInterface
[out]metadataobject containing metadata associated with saved game, parsed from metadata.json inside the archive.
[out]savedStateserialized simulation state stored as string of bytes, loaded from simulation.dat inside the archive.
Returns
INFO::OK if successfully loaded, else an error Status

Definition at line 152 of file SavedGame.cpp.

Status SavedGames::Save ( const std::wstring &  name,
const std::wstring &  description,
CSimulation2 simulation,
CGUIManager gui,
int  playerID 
)

Create new saved game archive with given name and simulation data.

Parameters
nameName to save the game with
descriptionA user-given description of the save
simulation
guiif not NULL, store some UI-related data with the saved game
playerIDID of the player who saved this file
Returns
INFO::OK if successfully saved, else an error Status

Definition at line 50 of file SavedGame.cpp.

Status SavedGames::SavePrefix ( const std::wstring &  prefix,
const std::wstring &  description,
CSimulation2 simulation,
CGUIManager gui,
int  playerID 
)

Create new saved game archive with given prefix and simulation data.

Parameters
prefixCreate new numbered file starting with this prefix
descriptionA user-given description of the save
simulation
guiif not NULL, store some UI-related data with the saved game
playerIDID of the player who saved this file
Returns
INFO::OK if successfully saved, else an error Status

Definition at line 35 of file SavedGame.cpp.