Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Static Public Member Functions | List of all members
GamePersistence Class Reference

Handles saving and loading of SFS files and FlightState objects. Use this as an entry point for all saving/loading-related things. More...

Static Public Member Functions

static Game CreateNewGame (string name, Game.Modes mode, GameParameters parameters, string flagURL, GameScenes startScene, EditorFacility editorFacility)
 
static Game LoadGame (string filename, string saveFolder, bool nullIfIncompatible, bool suppressIncompatibleMessage)
 Loads a game state from the given file. Does not actually apply the loaded game state to the scene. Use Game.Start() or Game.Load() for that. More...
 
static Game LoadGameCfg (ConfigNode node, string saveName, bool nullIfIncompatible, bool suppressIncompatibleMessage)
 
static ConfigNode LoadSFSFile (string filename, string saveFolder)
 
static string SaveGame (string saveFileName, string saveFolder, SaveMode saveMode)
 Updates and saves the game state to the given file name on the given save folder. More...
 
static string SaveGame (Game game, string saveFileName, string saveFolder, SaveMode saveMode)
 Saves an SFS file from the given Game object with the supplied filename More...
 
static string SaveGame (GameBackup game, string saveFileName, string saveFolder, SaveMode saveMode)
 Saves an SFS file from the given Game object with the supplied filename More...
 
static bool UpdateScenarioModules (Game game)
 

Detailed Description

Handles saving and loading of SFS files and FlightState objects. Use this as an entry point for all saving/loading-related things.

Member Function Documentation

static Game GamePersistence.CreateNewGame ( string  name,
Game.Modes  mode,
GameParameters  parameters,
string  flagURL,
GameScenes  startScene,
EditorFacility  editorFacility 
)
inlinestatic

< add scenario modules

static Game GamePersistence.LoadGame ( string  filename,
string  saveFolder,
bool  nullIfIncompatible,
bool  suppressIncompatibleMessage 
)
inlinestatic

Loads a game state from the given file. Does not actually apply the loaded game state to the scene. Use Game.Start() or Game.Load() for that.

Parameters
filename
saveFolder
nullIfIncompatiblereturn null if the game turns out to be incompatible (NOTE: most members will be null for incompatible games)
suppressIncompatibleMessageskip displaying a popup dialog if the game is incompatible
Returns
Game or Null if file not found.
static Game GamePersistence.LoadGameCfg ( ConfigNode  node,
string  saveName,
bool  nullIfIncompatible,
bool  suppressIncompatibleMessage 
)
inlinestatic
static ConfigNode GamePersistence.LoadSFSFile ( string  filename,
string  saveFolder 
)
inlinestatic
static string GamePersistence.SaveGame ( string  saveFileName,
string  saveFolder,
SaveMode  saveMode 
)
inlinestatic

Updates and saves the game state to the given file name on the given save folder.

static string GamePersistence.SaveGame ( Game  game,
string  saveFileName,
string  saveFolder,
SaveMode  saveMode 
)
inlinestatic

Saves an SFS file from the given Game object with the supplied filename

static string GamePersistence.SaveGame ( GameBackup  game,
string  saveFileName,
string  saveFolder,
SaveMode  saveMode 
)
inlinestatic

Saves an SFS file from the given Game object with the supplied filename

static bool GamePersistence.UpdateScenarioModules ( Game  game)
inlinestatic

The documentation for this class was generated from the following file: