KSP API
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties
Public Member Functions | Static Public Member Functions | List of all members
GamePersistence Class Reference

Contains some functions you can call to save the game state to a persistence file, or load the game state from a persistence file. More...

Inheritance diagram for GamePersistence:

Public Member Functions

 GamePersistence ()
 

Static Public Member Functions

static FlightState LoadFlightState (string filename, string saveFolder, bool haltIfIncompatible, bool suppressErrorMessage)
 
static Game LoadGame (string filename, string saveFolder, bool haltIfIncompatible, bool suppressErrorMessage)
 
static string SaveFlightState (string saveFileName, string saveFolder, SaveMode saveMode)
 
static string SaveFlightState (FlightState st, string saveFileName, string saveFolder, SaveMode saveMode)
 
static string SaveGame (string saveFileName, string saveFolder, SaveMode saveMode)
 Creates a persistence file containing the current game state. Probably persistent.sfs and quicksave.sfs are generated by calls to this function. More...
 
static string SaveGame (Game game, string saveFileName, string saveFolder, SaveMode saveMode)
 

Detailed Description

Contains some functions you can call to save the game state to a persistence file, or load the game state from a persistence file.

Constructor & Destructor Documentation

GamePersistence.GamePersistence ( )

Member Function Documentation

static FlightState GamePersistence.LoadFlightState ( string  filename,
string  saveFolder,
bool  haltIfIncompatible,
bool  suppressErrorMessage 
)
static
static Game GamePersistence.LoadGame ( string  filename,
string  saveFolder,
bool  haltIfIncompatible,
bool  suppressErrorMessage 
)
static
static string GamePersistence.SaveFlightState ( string  saveFileName,
string  saveFolder,
SaveMode  saveMode 
)
static
static string GamePersistence.SaveFlightState ( FlightState  st,
string  saveFileName,
string  saveFolder,
SaveMode  saveMode 
)
static
static string GamePersistence.SaveGame ( string  saveFileName,
string  saveFolder,
SaveMode  saveMode 
)
static

Creates a persistence file containing the current game state. Probably persistent.sfs and quicksave.sfs are generated by calls to this function.

Parameters
saveFileNameThe name of the persistence file to create (".sfs" will be appended to the file name).
saveFolderThe folder in which to create the save file. Try using HighLogic.SaveFolder.
saveModeWhether to overwrite, append, or abort if the given file already exists.
Returns
Returns the filename on success. Returns an empty string when the file already exists and SaveMode.ABORT is used.
static string GamePersistence.SaveGame ( Game  game,
string  saveFileName,
string  saveFolder,
SaveMode  saveMode 
)
static

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