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

Defines a complete game save. More...

Public Types

enum  GameStatus { GameStatus.UNSTARTED, GameStatus.ONGOING, GameStatus.FAILED_OR_ABORTED, GameStatus.COMPLETED }
 
enum  Modes {
  Modes.SANDBOX, Modes.CAREER, Modes.SCENARIO, Modes.SCENARIO_NON_RESUMABLE,
  Modes.SCIENCE_SANDBOX, Modes.MISSION, Modes.MISSION_BUILDER
}
 

Public Member Functions

ProtoScenarioModule AddProtoScenarioModule (System.Type typeOfScnModule, params GameScenes[] scenes)
 Creates and adds a protoscenariomodule in the game state from the given ScenarioModule type and target scenes. Use to inject a scenario module into the running game. Mind modules will not be spawned until the game is reloaded. More...
 
ProtoVessel AddVessel (ConfigNode protoVesselNode)
 
bool DestroyVessel (Vessel v)
 
 Game ()
 Create a new (blank) Game State More...
 
 Game (ConfigNode root)
 
string GetCometNumberedName (string name)
 
bool IsResumable ()
 
void Load ()
 Applies the state to the scene (does not wipe the scene beforehand) More...
 
void LoadCometNames (ConfigNode node)
 
void MergeLoaderInfo (ConfigNode node)
 
bool RemoveProtoScenarioModule (System.Type typeOfScnModule)
 
void Save (ConfigNode rootNode)
 
void Start ()
 
override string ToString ()
 
Game Updated ()
 Updates the state based on game conditions, then returns it More...
 
Game Updated (GameScenes startSceneOverride)
 Updates the state based on game conditions, then returns it More...
 

Static Public Member Functions

static ProtoScenarioModule AddProtoScenarioModule (List< ProtoScenarioModule > scenarioList, bool returnNullIfUnchanged, bool addScenarioToScenarioListIfNew, System.Type typeOfScnModule, params GameScenes[] scenes)
 Creates a protoscenariomodule in the game state from the given ScenarioModule type and target scenes. Use to inject a scenario module for the mission builder. More...
 
static Game GetCloneOf (Game g)
 Creates a deep copy of the given state More...
 

Public Attributes

ConfigNode additionalSystems
 
DictionaryValueList< string, int > cometNames = new DictionaryValueList<string,int>()
 Cometnames in use in this game, the int value is the highest number of discovered comet as research teams discover more than one in our universe More...
 
bool compatible
 
ConfigNode config
 
KerbalRoster CrewRoster
 
string defaultSPHLaunchSite = "Runway"
 This is the currently set default launchSite name for the SPH More...
 
string defaultVABLaunchSite = "LaunchPad"
 This is the currently set default launchSite name for the VAB More...
 
string Description
 
EditorFacility editorFacility
 later, add other modules in here to have tutorials and other stuff defined More...
 
int file_version_major
 
int file_version_minor
 
int file_version_revision
 
string flagURL
 
FlightState flightState
 
const int lastCompatibleMajor = 0
 
const int lastCompatibleMinor = 21
 
const int lastCompatibleRev = 0
 
uint launchID = 1
 
string linkCaption
 
string linkURL
 
Dictionary< string, bool > loaderInfo = new Dictionary<string, bool>()
 
Mission missionToStart
 
bool modded
 
Modes Mode
 
GameParameters Parameters
 
int ROCSeed = -1
 
List< ProtoScenarioModulescenarios
 
int Seed = -1
 
GameScenes startScene
 
GameStatus Status
 
string Title
 
string versionCreated = "unknown"
 
string versionFull = ""
 

Properties

bool CurrenciesAvailable [get]
 
bool IsMissionMode [get]
 Indicates when KSP is running in either Mission Builder or Mission play mode, as opposed to a "regular" game mode. More...
 
double UniversalTime [get]
 

Detailed Description

Defines a complete game save.

Member Enumeration Documentation

Enumerator
UNSTARTED 
ONGOING 
FAILED_OR_ABORTED 
COMPLETED 
enum Game.Modes
Enumerator
SANDBOX 
CAREER 
SCENARIO 
SCENARIO_NON_RESUMABLE 
SCIENCE_SANDBOX 
MISSION 
MISSION_BUILDER 

Constructor & Destructor Documentation

Game.Game ( )
inline

Create a new (blank) Game State

< get parameters off the current loaded game, when available.

< if it's been generated by this version, it's compatible with this version :)

Game.Game ( ConfigNode  root)
inline

Member Function Documentation

ProtoScenarioModule Game.AddProtoScenarioModule ( System.Type  typeOfScnModule,
params GameScenes[]  scenes 
)
inline

Creates and adds a protoscenariomodule in the game state from the given ScenarioModule type and target scenes. Use to inject a scenario module into the running game. Mind modules will not be spawned until the game is reloaded.

Parameters
typeOfScnModule
scenes
static ProtoScenarioModule Game.AddProtoScenarioModule ( List< ProtoScenarioModule scenarioList,
bool  returnNullIfUnchanged,
bool  addScenarioToScenarioListIfNew,
System.Type  typeOfScnModule,
params GameScenes[]  scenes 
)
inlinestatic

Creates a protoscenariomodule in the game state from the given ScenarioModule type and target scenes. Use to inject a scenario module for the mission builder.

Parameters
scenarioList
returnNullIfUnchanged
addScenarioToScenarioListIfNew
typeOfScnModule
scenes
ProtoVessel Game.AddVessel ( ConfigNode  protoVesselNode)
inline
bool Game.DestroyVessel ( Vessel  v)
inline
static Game Game.GetCloneOf ( Game  g)
inlinestatic

Creates a deep copy of the given state

Parameters
g
Returns
string Game.GetCometNumberedName ( string  name)
inline

<sThis should="" do="" meummary>=""> Add the final number to the comet name and if the name already have a number then takes that number and add +1 For example, if we get the name Bob we get the largest used number from the save and add 1 have Bob 1 then we just add a +1 and the final name will be Bob 2

Parameters
nameName of comet discoverer
Returns
Name of the comet including its number
bool Game.IsResumable ( )
inline
void Game.Load ( )
inline

Applies the state to the scene (does not wipe the scene beforehand)

void Game.LoadCometNames ( ConfigNode  node)
inline
void Game.MergeLoaderInfo ( ConfigNode  node)
inline
bool Game.RemoveProtoScenarioModule ( System.Type  typeOfScnModule)
inline
void Game.Save ( ConfigNode  rootNode)
inline
void Game.Start ( )
inline
override string Game.ToString ( )
inline
Game Game.Updated ( )
inline

Updates the state based on game conditions, then returns it

Returns
Game Game.Updated ( GameScenes  startSceneOverride)
inline

Updates the state based on game conditions, then returns it

Parameters
startSceneOverrideWill be used to override the start scene. This is ONLY used by Mission games
Returns

< if it's been generated by this version, it's compatible with this version :)

Member Data Documentation

ConfigNode Game.additionalSystems
DictionaryValueList<string,int> Game.cometNames = new DictionaryValueList<string,int>()

Cometnames in use in this game, the int value is the highest number of discovered comet as research teams discover more than one in our universe

bool Game.compatible
ConfigNode Game.config
KerbalRoster Game.CrewRoster
string Game.defaultSPHLaunchSite = "Runway"

This is the currently set default launchSite name for the SPH

string Game.defaultVABLaunchSite = "LaunchPad"

This is the currently set default launchSite name for the VAB

string Game.Description
EditorFacility Game.editorFacility

later, add other modules in here to have tutorials and other stuff defined

int Game.file_version_major
int Game.file_version_minor
int Game.file_version_revision
string Game.flagURL
FlightState Game.flightState
const int Game.lastCompatibleMajor = 0
const int Game.lastCompatibleMinor = 21
const int Game.lastCompatibleRev = 0
uint Game.launchID = 1
string Game.linkCaption
string Game.linkURL
Dictionary<string, bool> Game.loaderInfo = new Dictionary<string, bool>()
Mission Game.missionToStart
bool Game.modded
Modes Game.Mode
GameParameters Game.Parameters
int Game.ROCSeed = -1
List<ProtoScenarioModule> Game.scenarios
int Game.Seed = -1
GameScenes Game.startScene
GameStatus Game.Status
string Game.Title
string Game.versionCreated = "unknown"
string Game.versionFull = ""

Property Documentation

bool Game.CurrenciesAvailable
get
bool Game.IsMissionMode
get

Indicates when KSP is running in either Mission Builder or Mission play mode, as opposed to a "regular" game mode.

double Game.UniversalTime
get

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