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

Represents the saved state of a ship in flight More...

Public Member Functions

void AddCrew (ProtoCrewMember pcm)
 
void Clean (string reason="")
 
List< ProtoPartSnapshotGetAllProtoPartsFromCrew ()
 Get all the protoparts inside the inventory of the crew in the protovessel, for stacks it will return multiple parts - one for each part in the stack More...
 
List< ProtoPartSnapshotGetAllProtoPartsIncludingCargo ()
 Get all the protoparts in the protovessel including ones stored inside InventoryContainers, for stacks it will return multiple parts - one for each part in the stack More...
 
string GetDisplayName ()
 Returns the localized string of the vesselName. More...
 
List< ProtoCrewMemberGetVesselCrew ()
 
void Load (FlightState st)
 
void LoadObjects ()
 
 ProtoVessel (Vessel VesselRef)
 Create a ProtoVessel instance, based on the given Vessel object. More...
 
 ProtoVessel (Vessel VesselRef, bool preCreate)
 Create a ProtoVessel instance, based on the given Vessel object. More...
 
 ProtoVessel (ConfigNode node, Game st)
 Create a ProtoVessel instance from the loaded text file More...
 
void RebuildCrewCounts ()
 
bool RemoveCrew (ProtoCrewMember pcm)
 
void ResetProtoPartSnapShots ()
 
void Save (ConfigNode node)
 
void SaveVesselModules ()
 

Static Public Member Functions

static ConfigNode CreateDiscoveryNode (DiscoveryLevels level, UntrackedObjectClass size, double lifeTime, double maxLifeTime)
 
static ConfigNode CreateOrbitNode (Orbit orbit)
 
static ConfigNode CreatePartNode (string partName, uint id, params ProtoCrewMember[] crew)
 
static ConfigNode CreateVesselNode (string vesselName, VesselType vesselType, Orbit orbit, int rootPartIndex, ConfigNode[] partNodes, params ConfigNode[] additionalNodes)
 
static string GetSituationString (ProtoVessel pv, List< CelestialBody > bodies)
 

Public Attributes

ConfigNode actionGroups
 
AltimeterDisplayState altimeterDisplayState
 
double altitude
 
bool autoClean = false
 
string autoCleanReason = string.Empty
 
Vector3 CoM
 
int crewableParts = 0
 
int crewedParts = 0
 
ConfigNode ctrlState
 
ConfigNode discoveryInfo
 
string displaylandedAt = ""
 
double distanceTraveled = 0
 
ConfigNode flightPlan
 
int GroupOverride
 The vessel's active action group override set More...
 
float height
 
bool landed
 
string landedAt = ""
 
double lastUT = -1
 
double latitude
 
string launchedFrom = ""
 
double launchTime
 
double longitude
 
double missionTime
 
Vector3 normal
 
OrbitSnapshot orbitSnapShot
 
KSPActionGroup[] OverrideActionControl
 Whether the axis group in the selected override group overrides the default vessel axis controls. Does not include the default group More...
 
KSPAxisGroup[] OverrideAxisControl
 
bool[] OverrideDefault
 Whether the selected override group overrides the default group. Does not include the default group More...
 
string[] OverrideGroupNames
 Names for the override groups. Does not include the default group More...
 
bool persistent
 
uint persistentId = 0
 
Vector3d position
 
int PQSmaxLevel = 0
 
int PQSminLevel = 0
 
List< ProtoPartSnapshotprotoPartSnapshots
 
uint refTransform = 0
 position and rotation are only used when landed or splashed. More...
 
int rootIndex
 
Quaternion rotation
 
Vessel.Situations situation
 
bool skipGroundPositioning
 
bool skipGroundPositioningForDroppedPart
 
bool splashed
 
int stage
 
ProtoTargetInfo targetInfo
 
Guid vesselID = Guid.Empty
 For quick, easy upgrades. More...
 
ConfigNode vesselModules
 
string vesselName = "Unnamed Vessel"
 Beware this could be a localization Tag - Not localized. It's better to use GetDisplayName() to get the localized displayable vessel name for UI purposes. More...
 
Vessel vesselRef
 
bool vesselSpawning
 
Dictionary< string, KSPParseablevesselStateValues
 
VesselType vesselType
 
bool wasControllable = false
 
ProtoWaypointInfo waypointInfo
 Cache List for the parts that need to drain resources when packed are loaded and saved by this class. More...
 

Static Public Attributes

static int MissingPartsWindowIndex = 0
 

Detailed Description

Represents the saved state of a ship in flight

Constructor & Destructor Documentation

ProtoVessel.ProtoVessel ( Vessel  VesselRef)
inline

Create a ProtoVessel instance, based on the given Vessel object.

ProtoVessel.ProtoVessel ( Vessel  VesselRef,
bool  preCreate 
)
inline

Create a ProtoVessel instance, based on the given Vessel object.

< call a method on Vessels, to let them save state values here.

< Notify we created the info.

ProtoVessel.ProtoVessel ( ConfigNode  node,
Game  st 
)
inline

Create a ProtoVessel instance from the loaded text file

Member Function Documentation

void ProtoVessel.AddCrew ( ProtoCrewMember  pcm)
inline
void ProtoVessel.Clean ( string  reason = "")
inline

< Check landed or altitude on the calling side, we're just checking if at the homeworld here for more versatility for things like stage recovery.

static ConfigNode ProtoVessel.CreateDiscoveryNode ( DiscoveryLevels  level,
UntrackedObjectClass  size,
double  lifeTime,
double  maxLifeTime 
)
inlinestatic
static ConfigNode ProtoVessel.CreateOrbitNode ( Orbit  orbit)
inlinestatic
static ConfigNode ProtoVessel.CreatePartNode ( string  partName,
uint  id,
params ProtoCrewMember[]  crew 
)
inlinestatic
static ConfigNode ProtoVessel.CreateVesselNode ( string  vesselName,
VesselType  vesselType,
Orbit  orbit,
int  rootPartIndex,
ConfigNode[]  partNodes,
params ConfigNode[]  additionalNodes 
)
inlinestatic

< Outputs as 32 hex chars.

List<ProtoPartSnapshot> ProtoVessel.GetAllProtoPartsFromCrew ( )
inline

Get all the protoparts inside the inventory of the crew in the protovessel, for stacks it will return multiple parts - one for each part in the stack

Returns
List of protoparts in this vessel's crew inventories
List<ProtoPartSnapshot> ProtoVessel.GetAllProtoPartsIncludingCargo ( )
inline

Get all the protoparts in the protovessel including ones stored inside InventoryContainers, for stacks it will return multiple parts - one for each part in the stack

Returns
List of protoparts in this vessel including cargoparts stored inside a ModuleInventoryPart
string ProtoVessel.GetDisplayName ( )
inline

Returns the localized string of the vesselName.

Returns
static string ProtoVessel.GetSituationString ( ProtoVessel  pv,
List< CelestialBody bodies 
)
inlinestatic
List<ProtoCrewMember> ProtoVessel.GetVesselCrew ( )
inline
void ProtoVessel.Load ( FlightState  st)
inline
void ProtoVessel.LoadObjects ( )
inline
void ProtoVessel.RebuildCrewCounts ( )
inline
bool ProtoVessel.RemoveCrew ( ProtoCrewMember  pcm)
inline
void ProtoVessel.ResetProtoPartSnapShots ( )
inline
void ProtoVessel.Save ( ConfigNode  node)
inline

< Outputs as 32 hex chars.

< notify we saved

void ProtoVessel.SaveVesselModules ( )
inline

Member Data Documentation

ConfigNode ProtoVessel.actionGroups
AltimeterDisplayState ProtoVessel.altimeterDisplayState
double ProtoVessel.altitude
bool ProtoVessel.autoClean = false
string ProtoVessel.autoCleanReason = string.Empty
Vector3 ProtoVessel.CoM
int ProtoVessel.crewableParts = 0
int ProtoVessel.crewedParts = 0
ConfigNode ProtoVessel.ctrlState
ConfigNode ProtoVessel.discoveryInfo
string ProtoVessel.displaylandedAt = ""
double ProtoVessel.distanceTraveled = 0
ConfigNode ProtoVessel.flightPlan
int ProtoVessel.GroupOverride

The vessel's active action group override set

float ProtoVessel.height
bool ProtoVessel.landed
string ProtoVessel.landedAt = ""
double ProtoVessel.lastUT = -1
double ProtoVessel.latitude
string ProtoVessel.launchedFrom = ""
double ProtoVessel.launchTime
double ProtoVessel.longitude
int ProtoVessel.MissingPartsWindowIndex = 0
static
double ProtoVessel.missionTime
Vector3 ProtoVessel.normal
OrbitSnapshot ProtoVessel.orbitSnapShot
KSPActionGroup [] ProtoVessel.OverrideActionControl

Whether the axis group in the selected override group overrides the default vessel axis controls. Does not include the default group

KSPAxisGroup [] ProtoVessel.OverrideAxisControl
bool [] ProtoVessel.OverrideDefault

Whether the selected override group overrides the default group. Does not include the default group

string [] ProtoVessel.OverrideGroupNames

Names for the override groups. Does not include the default group

bool ProtoVessel.persistent
uint ProtoVessel.persistentId = 0
Vector3d ProtoVessel.position
int ProtoVessel.PQSmaxLevel = 0
int ProtoVessel.PQSminLevel = 0
List<ProtoPartSnapshot> ProtoVessel.protoPartSnapshots
uint ProtoVessel.refTransform = 0

position and rotation are only used when landed or splashed.

int ProtoVessel.rootIndex
Quaternion ProtoVessel.rotation
Vessel.Situations ProtoVessel.situation
bool ProtoVessel.skipGroundPositioning
bool ProtoVessel.skipGroundPositioningForDroppedPart
bool ProtoVessel.splashed
int ProtoVessel.stage
ProtoTargetInfo ProtoVessel.targetInfo
Guid ProtoVessel.vesselID = Guid.Empty

For quick, easy upgrades.

ConfigNode ProtoVessel.vesselModules
string ProtoVessel.vesselName = "Unnamed Vessel"

Beware this could be a localization Tag - Not localized. It's better to use GetDisplayName() to get the localized displayable vessel name for UI purposes.

Vessel ProtoVessel.vesselRef
bool ProtoVessel.vesselSpawning
Dictionary<string, KSPParseable> ProtoVessel.vesselStateValues
VesselType ProtoVessel.vesselType
bool ProtoVessel.wasControllable = false
ProtoWaypointInfo ProtoVessel.waypointInfo

Cache List for the parts that need to drain resources when packed are loaded and saved by this class.

Information about the active Navigation waypoint


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