Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
ShipConstruct Class Reference
Inheritance diagram for ShipConstruct:
IShipconstruct

Public Member Functions

void Add (Part p)
 
bool AreAllPartsConnected ()
 
void Clear ()
 
bool Contains (Part p)
 
void GetConnectedResourceTotals (int id, bool simulate, out double amount, out double maxAmount, bool pulling=true)
 Gets the amount and maxamount of the given resource in the resourcePartSet. If the resourcePartSet has not been created via UpdateResourceSets will return zero. More...
 
IEnumerator< PartGetEnumerator ()
 
float GetShipCosts (out float dryCost, out float fuelCost)
 Get the drycost and fuelcost for the Ship. Does NOT account for assigned crew. More...
 
float GetShipCosts (out float dryCost, out float fuelCost, VesselCrewManifest vcm)
 Get the drycost and fuel cost for the Ship. Does account for assigned crew from the passed in VesselCrewManifest. More...
 
float GetShipMass (out float dryMass, out float fuelMass)
 Get the dryMass and fuelMass for the Ship. Does NOT account for assigned crew mass. More...
 
float GetShipMass (out float dryMass, out float fuelMass, VesselCrewManifest vcm)
 Get the dryMass and fuelMass for the Ship. Does account for assigned crew inventory mass. More...
 
float GetTotalMass ()
 Get the Total Mass of the Ship. DOES account for crew inventory mass. Uses ShipConstruction.ShipManifest. More...
 
bool isControllable ()
 Returns true if at least one part on this ship is flagged as a control source More...
 
bool LoadShip (ConfigNode root, uint persistentID)
 Loads a ship from a craft config node with the supplied persistent id. This WILL create a VesselDeltaV Object. So make sure you destroy it when done. More...
 
bool LoadShip (ConfigNode root)
 Loads a ship from a craft config node More...
 
void Remove (Part p)
 
double RequestResource (Part part, int id, double demand, bool usePriority, bool simulate)
 Request a resource from across the vessel. If the resourcePartSet has not been created via UpdateResourceSets will return zero. More...
 
ConfigNode SaveShip ()
 
 ShipConstruct ()
 Create a ShipConstruct. Does NOT Instantiate VesselDeltaV object. Use VesselDeltaV.Create to instantiate the object if required. More...
 
 ShipConstruct (EditorFacility facility)
 Create a ShipConstruct. Does NOT Instantiate VesselDeltaV object. Use VesselDeltaV.Create to instantiate the object if required. More...
 
 ShipConstruct (string shipName, EditorFacility facility, List< Part > parts)
 Create a ShipConstruct. Does NOT Instantiate VesselDeltaV object. Use VesselDeltaV.Create to instantiate the object if required. More...
 
 ShipConstruct (string shipName, string shipDescription, Part rootPart)
 Create a ShipConstruct. Does NOT Instantiate VesselDeltaV object. Use VesselDeltaV.Create to instantiate the object if required. More...
 
 ShipConstruct (string shipName, string shipDescription, List< Part > parts)
 Create a ShipConstruct. Does NOT Instantiate VesselDeltaV object. Use VesselDeltaV.Create to instantiate the object if required. More...
 
void UpdateResourceSets ()
 Update the crossfeed PartSets for the Ship. More...
 

Public Attributes

string missionFlag = ""
 
KSPActionGroup[] OverrideActionControl
 Flags for whether each action group overrides the default vessel controls. More...
 
KSPAxisGroup[] OverrideAxisControl
 Flags for whether each axis group overrides the default vessel controls. More...
 
bool[] OverrideDefault
 Flags for whether each override group overrides the default group (true) or merges with the default group (false). More...
 
string[] OverrideGroupNames
 Names for the override groups (default is always default) More...
 
List< Partparts
 
uint persistentId = 0
 
PartSet resourcePartSet
 The ship partset. More...
 
Quaternion rotation
 
string shipDescription = string.Empty
 
EditorFacility shipFacility
 
string shipName = string.Empty
 
bool shipPartsUnlocked = true
 
Vector3 shipSize
 
ulong steamPublishedFileId = 0
 This is the steam published FileId for this mission if it has been published to steam. More...
 
VesselDeltaV vesselDeltaV
 This is the VesselDeltaV instance for this ShipConstruct. More...
 

Static Public Attributes

static int lastCompatibleMajor = 0
 
static int lastCompatibleMinor = 18
 
static int lastCompatibleRev = 0
 

Properties

int Count [get]
 
List< PartParts [get]
 
Part this[int index] [get, set]
 
- Properties inherited from IShipconstruct
List< PartParts [get]
 

Constructor & Destructor Documentation

ShipConstruct.ShipConstruct ( )
inline

Create a ShipConstruct. Does NOT Instantiate VesselDeltaV object. Use VesselDeltaV.Create to instantiate the object if required.

ShipConstruct.ShipConstruct ( EditorFacility  facility)
inline

Create a ShipConstruct. Does NOT Instantiate VesselDeltaV object. Use VesselDeltaV.Create to instantiate the object if required.

Parameters
facilityThe editorfacility to set
ShipConstruct.ShipConstruct ( string  shipName,
EditorFacility  facility,
List< Part parts 
)
inline

Create a ShipConstruct. Does NOT Instantiate VesselDeltaV object. Use VesselDeltaV.Create to instantiate the object if required.

Parameters
shipNameThe name to assign to the ship
facilityThe editorfacility to set
partsThe list of parts to assign to the ship
ShipConstruct.ShipConstruct ( string  shipName,
string  shipDescription,
Part  rootPart 
)
inline

Create a ShipConstruct. Does NOT Instantiate VesselDeltaV object. Use VesselDeltaV.Create to instantiate the object if required.

Parameters
shipNameThe name to assign to the ship
shipDescriptionThe ship description to set
rootPartThe root part to set
ShipConstruct.ShipConstruct ( string  shipName,
string  shipDescription,
List< Part parts 
)
inline

Create a ShipConstruct. Does NOT Instantiate VesselDeltaV object. Use VesselDeltaV.Create to instantiate the object if required.

Parameters
shipNameThe name to assign to the ship
shipDescriptionThe ship description to set
partsThe list of parts to assign to the ship

Member Function Documentation

void ShipConstruct.Add ( Part  p)
inline
bool ShipConstruct.AreAllPartsConnected ( )
inline
void ShipConstruct.Clear ( )
inline
bool ShipConstruct.Contains ( Part  p)
inline
void ShipConstruct.GetConnectedResourceTotals ( int  id,
bool  simulate,
out double  amount,
out double  maxAmount,
bool  pulling = true 
)
inline

Gets the amount and maxamount of the given resource in the resourcePartSet. If the resourcePartSet has not been created via UpdateResourceSets will return zero.

Parameters
idthe hash of the resource
simulateSet to true to use the simulationResourcePartSet
amountavailable amount will be stored here (will be headroom if pulling==false)
maxAmountmax possible amount will be stored here
pullingare we planning to push or pull resources from the parts
IEnumerator<Part> ShipConstruct.GetEnumerator ( )
inline
float ShipConstruct.GetShipCosts ( out float  dryCost,
out float  fuelCost 
)
inline

Get the drycost and fuelcost for the Ship. Does NOT account for assigned crew.

Parameters
dryCost
fuelCost
Returns
float ShipConstruct.GetShipCosts ( out float  dryCost,
out float  fuelCost,
VesselCrewManifest  vcm 
)
inline

Get the drycost and fuel cost for the Ship. Does account for assigned crew from the passed in VesselCrewManifest.

Parameters
dryCost
fuelCost
vcm
Returns

< figure out how much of a part's total cost is comprised of resources inside it.

float ShipConstruct.GetShipMass ( out float  dryMass,
out float  fuelMass 
)
inline

Get the dryMass and fuelMass for the Ship. Does NOT account for assigned crew mass.

Parameters
dryMass
fuelMass
Returns
float ShipConstruct.GetShipMass ( out float  dryMass,
out float  fuelMass,
VesselCrewManifest  vcm 
)
inline

Get the dryMass and fuelMass for the Ship. Does account for assigned crew inventory mass.

Parameters
dryMass
fuelMass
vcm
Returns

< part.mass describes its dry mass, so just add all mass for any resources it contains

float ShipConstruct.GetTotalMass ( )
inline

Get the Total Mass of the Ship. DOES account for crew inventory mass. Uses ShipConstruction.ShipManifest.

Returns
bool ShipConstruct.isControllable ( )
inline

Returns true if at least one part on this ship is flagged as a control source

Returns
bool ShipConstruct.LoadShip ( ConfigNode  root,
uint  persistentID 
)
inline

Loads a ship from a craft config node with the supplied persistent id. This WILL create a VesselDeltaV Object. So make sure you destroy it when done.

Parameters
rootCraft config node
persistentIDVessel persistent id
Returns
bool ShipConstruct.LoadShip ( ConfigNode  root)
inline

Loads a ship from a craft config node

Parameters
rootCraft config node
Returns
void ShipConstruct.Remove ( Part  p)
inline
double ShipConstruct.RequestResource ( Part  part,
int  id,
double  demand,
bool  usePriority,
bool  simulate 
)
inline

Request a resource from across the vessel. If the resourcePartSet has not been created via UpdateResourceSets will return zero.

Parameters
partThe part requesting the pull/push of the resource
idthe hash of the resource
demandthe demand in units, positive means draw (pull), negative means push
usePrioritydraw in staging order
simulateSet to true to use the simulationResourcePartSet
Returns
ConfigNode ShipConstruct.SaveShip ( )
inline

< try recalculating ship size here again, some ctors don't have enough info to set it up correctly there.

void ShipConstruct.UpdateResourceSets ( )
inline

Update the crossfeed PartSets for the Ship.

Member Data Documentation

int ShipConstruct.lastCompatibleMajor = 0
static
int ShipConstruct.lastCompatibleMinor = 18
static
int ShipConstruct.lastCompatibleRev = 0
static
string ShipConstruct.missionFlag = ""
KSPActionGroup [] ShipConstruct.OverrideActionControl

Flags for whether each action group overrides the default vessel controls.

KSPAxisGroup [] ShipConstruct.OverrideAxisControl

Flags for whether each axis group overrides the default vessel controls.

bool [] ShipConstruct.OverrideDefault

Flags for whether each override group overrides the default group (true) or merges with the default group (false).

string [] ShipConstruct.OverrideGroupNames

Names for the override groups (default is always default)

List<Part> ShipConstruct.parts
uint ShipConstruct.persistentId = 0
PartSet ShipConstruct.resourcePartSet

The ship partset.

Quaternion ShipConstruct.rotation
string ShipConstruct.shipDescription = string.Empty
EditorFacility ShipConstruct.shipFacility
string ShipConstruct.shipName = string.Empty
bool ShipConstruct.shipPartsUnlocked = true
Vector3 ShipConstruct.shipSize
ulong ShipConstruct.steamPublishedFileId = 0

This is the steam published FileId for this mission if it has been published to steam.

VesselDeltaV ShipConstruct.vesselDeltaV

This is the VesselDeltaV instance for this ShipConstruct.

Property Documentation

int ShipConstruct.Count
get
List<Part> ShipConstruct.Parts
get
Part ShipConstruct.this[int index]
getset

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