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 | Properties | List of all members
VesselCrewManifest Class Reference

Class which represents the parts in a vessel and the crew members which are assigned to them. More...

Public Member Functions

bool AnyCrewInState (ProtoCrewMember.RosterStatus state, bool notInState=false)
 Checks whether there are any crew members in the VesselCrewManifest in a certain state. More...
 
bool AnyCrewInState (ProtoCrewMember.RosterStatus state, KerbalRoster roster, bool notInState=false)
 Checks whether there are any crew members in the VesselCrewManifest in a certain state. More...
 
bool AnyCrewWithTrait (string trait, bool noCrewWithTrait=false)
 Checks whether there are any crew members in the VesselCrewManifest with a certain trait. More...
 
bool AnyCrewWithTrait (string trait, KerbalRoster roster, bool noCrewWithTrait=false)
 Checks whether there are any crew members in the VesselCrewManifest with a certain trait. More...
 
void AssignCrewToVessel (ShipConstruct ship)
 Assigns the crew in this VesselCrewManifest to the ship. More...
 
void AssignCrewToVessel (ShipConstruct ship, KerbalRoster roster)
 Assigns the crew in this VesselCrewManifest to the ship. More...
 
bool Contains (ProtoCrewMember crew)
 Check whether the VesselCrewManifest contains a crew member. More...
 
void DebugManifest ()
 Print out information concerning all the seats (and their occupants) in this VesselCrewManifest. More...
 
void Filter (Func< PartCrewManifest, bool > inclusionFilter)
 Filters this vessel manifest excluding parts that don't meet the given criteria. More...
 
List< ProtoCrewMemberGetAllCrew (bool includeNulls)
 Get a list of all of the crew in the VesselCrewManifest. More...
 
List< ProtoCrewMemberGetAllCrew (bool includeNulls, KerbalRoster roster)
 Get a list of all of the crew in the VesselCrewManifest. More...
 
List< PartCrewManifestGetCrewableParts ()
 Get a list of the parts which can be crewed. More...
 
float GetCrewInventoryCosts (KerbalRoster roster=null)
 Get the Crew Inventory Costs. If roster is not supplied will use HighLogic.CurrentGame.CrewRoster. More...
 
float GetCrewInventoryMass ()
 Get the Crew Inventory Mass. Will use HighLogic.CurrentGame.CrewRoster. More...
 
float GetCrewInventoryMass (KerbalRoster roster)
 Get the Crew Inventory Mass. If roster is not supplied will use HighLogic.CurrentGame.CrewRoster. More...
 
float GetCrewResourceMass ()
 Get the Crew Resource Mass. Will use HighLogic.CurrentGame.CrewRoster. More...
 
float GetCrewResourceMass (KerbalRoster roster)
 Get the Crew Resource Mass. If roster is not supplied will use HighLogic.CurrentGame.CrewRoster. More...
 
PartCrewManifest GetPartCrewManifest (uint id)
 Gets the PartCrewManifest with the specified id More...
 
PartCrewManifest GetPartForCrew (ProtoCrewMember crew)
 Gets the PartCrewManifest in which the crew member is seated. More...
 
bool HasAnyCrew ()
 Checks whether there are any crew members in the VesselCrewManifest. More...
 
bool HasAnyCrew (KerbalRoster roster)
 Checks whether there are any crew members in the VesselCrewManifest. More...
 
void RemoveCrewMember (string cName)
 Removes a crew member from the previously assigned part and this crew manifest. More...
 
void RemovePartManifest (PartCrewManifest pcm)
 Removes the part and the crew assigned to it from this VesselCrewManifest. More...
 
void SetCrewMember (string cName, PartCrewManifest pcm)
 Removes a crew member from its previously assigned part and assigns it to the new part. More...
 
void SetPartManifest (uint id, PartCrewManifest newPCMtoUse)
 Adds a PartCrewManifest with the specified id. Removes the crew from the previous part if there was one using the specified id, then removes the part. Checks whether the crew in the new part are assigned to a previously used part and removes them from that previously used part if they are. More...
 
void SetPartManifestNoOverwrite (uint id, PartCrewManifest newPCMtoUse)
 Adds a PartCrewManifest with the specified id. Removes the crew from the previous part if there was one using the specified id, then removes the part. Checks whether the crew in the new part are assigned to a previously used part and removes them from the new part if they are. More...
 
VesselCrewManifest UpdateCrewForVessel (ConfigNode vesselNode, System.Func< PartCrewManifest, bool > persistFilter=null)
 Creates a new VesselCrewManifest from vesselNode. Then assigns the crew members from this VesselCrewManifest to the new VesselCrewManifest if they pass the persistFilter. More...
 
void UpdatePartManifest (uint id, PartCrewManifest referencePCM)
 Updates a PartCrewManifest with the specified id to have the crew members in the referencePCM. Removes the crew in the referencePCM from the previous assigned part if there was one. Then assigns the crew in the referencePCM to the part with the specified id. More...
 
 VesselCrewManifest ()
 Base constructor. More...
 

Static Public Member Functions

static VesselCrewManifest CloneOf (VesselCrewManifest original, bool blank)
 Clone a vessel crew manifest. More...
 
static VesselCrewManifest FromConfigNode (ConfigNode craftNode)
 Generate a vessel crew manifest based on a craft node. More...
 
static void MergeInto (VesselCrewManifest m1, VesselCrewManifest m2, Func< PartCrewManifest, bool > inclusionFilter=null)
 Merge m2 into m1 and discard anything failing the the inclusion filter. If an entry is contained in both, the one from m1 is kept. If a crewmember is present in more than one part, it will be removed from any parts after the first ocurrence. More...
 

Properties

int CrewCount [get]
 Number of crew members in the vessel. More...
 
float CrewCountOptimizedForFloat [get]
 Number of crew members in the vessel. (Returned as a float) More...
 
int PartCount [get]
 Number of parts in the vessel. More...
 
List< PartCrewManifestPartManifests [get]
 List of the parts in the vessel. More...
 

Detailed Description

Class which represents the parts in a vessel and the crew members which are assigned to them.

Constructor & Destructor Documentation

VesselCrewManifest.VesselCrewManifest ( )
inline

Base constructor.

Member Function Documentation

bool VesselCrewManifest.AnyCrewInState ( ProtoCrewMember.RosterStatus  state,
bool  notInState = false 
)
inline

Checks whether there are any crew members in the VesselCrewManifest in a certain state.

Parameters
stateState to check for.
notInStateIf false, returns true when any crew member is in that state. If true, returns true when any crew member is not in that state.
Returns
Returns true if there are any crew members in the VesselCrewManifest in that state, false if there are none. Does the opposite if notInState is set to true.
bool VesselCrewManifest.AnyCrewInState ( ProtoCrewMember.RosterStatus  state,
KerbalRoster  roster,
bool  notInState = false 
)
inline

Checks whether there are any crew members in the VesselCrewManifest in a certain state.

Parameters
stateState to check for.
rosterRoster to get the crew member information from.
notInStateIf false, returns true when any crew member is in that state. If true, returns true when any crew member is not in that state.
Returns
Returns true if there are any crew members in the VesselCrewManifest in that state, false if there are none. Does the opposite if notInState is set to true.
bool VesselCrewManifest.AnyCrewWithTrait ( string  trait,
bool  noCrewWithTrait = false 
)
inline

Checks whether there are any crew members in the VesselCrewManifest with a certain trait.

Parameters
traitTrait to check for.
noCrewWithTraitIf false, returns true when any crew member has that trait. If true, returns true when any crew member doesn't have that trait.
Returns
Returns true if there are any crew members in the VesselCrewManifest have that trait, false if there are none. Does the opposite if noCrewWithTrait is set to true.
bool VesselCrewManifest.AnyCrewWithTrait ( string  trait,
KerbalRoster  roster,
bool  noCrewWithTrait = false 
)
inline

Checks whether there are any crew members in the VesselCrewManifest with a certain trait.

Parameters
traitTrait to check for.
rosterRoster to get the crew member information from.
noCrewWithTraitIf false, returns true when any crew member has that trait. If true, returns true when any crew member doesn't have that trait.
Returns
Returns true if there are any crew members in the VesselCrewManifest have that trait, false if there are none. Does the opposite if noCrewWithTrait is set to true.
void VesselCrewManifest.AssignCrewToVessel ( ShipConstruct  ship)
inline

Assigns the crew in this VesselCrewManifest to the ship.

Parameters
shipShip to assign the crew to.
void VesselCrewManifest.AssignCrewToVessel ( ShipConstruct  ship,
KerbalRoster  roster 
)
inline

Assigns the crew in this VesselCrewManifest to the ship.

Parameters
shipShip to assign the crew to.
rosterRoster to get the crew member information from.
static VesselCrewManifest VesselCrewManifest.CloneOf ( VesselCrewManifest  original,
bool  blank 
)
inlinestatic

Clone a vessel crew manifest.

Parameters
originalVesselCrewManifest to be cloned
blankIf false, crew members from the original VesselCrewManifest will be seated in the clone. If true, there will be no crew members in the clone.
Returns
Returns a new VesselCrewManifest which is a clone of the original.
bool VesselCrewManifest.Contains ( ProtoCrewMember  crew)
inline

Check whether the VesselCrewManifest contains a crew member.

Parameters
crewCrew member to search for.
Returns
Returns true if crew member is in the VesselCrewManifest, false if the crew member isn't.
void VesselCrewManifest.DebugManifest ( )
inline

Print out information concerning all the seats (and their occupants) in this VesselCrewManifest.

void VesselCrewManifest.Filter ( Func< PartCrewManifest, bool >  inclusionFilter)
inline

Filters this vessel manifest excluding parts that don't meet the given criteria.

Parameters
inclusionFilterFilter to apply to the parts.
static VesselCrewManifest VesselCrewManifest.FromConfigNode ( ConfigNode  craftNode)
inlinestatic

Generate a vessel crew manifest based on a craft node.

Parameters
craftNodeVessel to be populated
Returns
Returns a new VesselCrewManifest based on a craft node.
List<ProtoCrewMember> VesselCrewManifest.GetAllCrew ( bool  includeNulls)
inline

Get a list of all of the crew in the VesselCrewManifest.

Parameters
includeNullsVesselCrewManifest to be cloned
Returns
Returns a list of all of the crew in the VesselCrewManifest.
List<ProtoCrewMember> VesselCrewManifest.GetAllCrew ( bool  includeNulls,
KerbalRoster  roster 
)
inline

Get a list of all of the crew in the VesselCrewManifest.

Parameters
includeNullsVesselCrewManifest to be cloned
rosterRoster to use to get the kerbal information.
Returns
Returns a list of all of the crew in the VesselCrewManifest.
List<PartCrewManifest> VesselCrewManifest.GetCrewableParts ( )
inline

Get a list of the parts which can be crewed.

Returns
Returns a list of the parts which can be crewed.
float VesselCrewManifest.GetCrewInventoryCosts ( KerbalRoster  roster = null)
inline

Get the Crew Inventory Costs. If roster is not supplied will use HighLogic.CurrentGame.CrewRoster.

Parameters
rosterThe KerbalRoster to use, if you don't want to use HighLogic.CurrentGame.CrewRoster
Returns
float VesselCrewManifest.GetCrewInventoryMass ( )
inline

Get the Crew Inventory Mass. Will use HighLogic.CurrentGame.CrewRoster.

Returns
float VesselCrewManifest.GetCrewInventoryMass ( KerbalRoster  roster)
inline

Get the Crew Inventory Mass. If roster is not supplied will use HighLogic.CurrentGame.CrewRoster.

Parameters
rosterSet to Null for HighLogic.CurrentGame.CrewRoster. Otherwise set to the KerbalRoster to use
Returns
float VesselCrewManifest.GetCrewResourceMass ( )
inline

Get the Crew Resource Mass. Will use HighLogic.CurrentGame.CrewRoster.

Returns
float VesselCrewManifest.GetCrewResourceMass ( KerbalRoster  roster)
inline

Get the Crew Resource Mass. If roster is not supplied will use HighLogic.CurrentGame.CrewRoster.

Parameters
rosterSet to Null for HighLogic.CurrentGame.CrewRoster. Otherwise set to the KerbalRoster to use
Returns
PartCrewManifest VesselCrewManifest.GetPartCrewManifest ( uint  id)
inline

Gets the PartCrewManifest with the specified id

Parameters
idid to search for.
Returns
Returns the PartCrewManifest with the specified id.
PartCrewManifest VesselCrewManifest.GetPartForCrew ( ProtoCrewMember  crew)
inline

Gets the PartCrewManifest in which the crew member is seated.

Parameters
crewCrew member to search for.
Returns
Returns the PartCrewManifest in which the crew member is seated.
bool VesselCrewManifest.HasAnyCrew ( )
inline

Checks whether there are any crew members in the VesselCrewManifest.

Returns
Returns true if there are any crew members in the VesselCrewManifest, false if there are none.
bool VesselCrewManifest.HasAnyCrew ( KerbalRoster  roster)
inline

Checks whether there are any crew members in the VesselCrewManifest.

Parameters
rosterRoster to get the crew member information from.
Returns
Returns true if there are any crew members in the VesselCrewManifest, false if there are none.
static void VesselCrewManifest.MergeInto ( VesselCrewManifest  m1,
VesselCrewManifest  m2,
Func< PartCrewManifest, bool >  inclusionFilter = null 
)
inlinestatic

Merge m2 into m1 and discard anything failing the the inclusion filter. If an entry is contained in both, the one from m1 is kept. If a crewmember is present in more than one part, it will be removed from any parts after the first ocurrence.

void VesselCrewManifest.RemoveCrewMember ( string  cName)
inline

Removes a crew member from the previously assigned part and this crew manifest.

Parameters
cNameCrew member to be removed.
void VesselCrewManifest.RemovePartManifest ( PartCrewManifest  pcm)
inline

Removes the part and the crew assigned to it from this VesselCrewManifest.

Parameters
pcmPart to be removed.
void VesselCrewManifest.SetCrewMember ( string  cName,
PartCrewManifest  pcm 
)
inline

Removes a crew member from its previously assigned part and assigns it to the new part.

Parameters
cNameCrew member to set.
pcmPart to assign the crew member to.
void VesselCrewManifest.SetPartManifest ( uint  id,
PartCrewManifest  newPCMtoUse 
)
inline

Adds a PartCrewManifest with the specified id. Removes the crew from the previous part if there was one using the specified id, then removes the part. Checks whether the crew in the new part are assigned to a previously used part and removes them from that previously used part if they are.

Parameters
idID to assign the new part.
newPCMtoUsePartCrewManifest to add.
void VesselCrewManifest.SetPartManifestNoOverwrite ( uint  id,
PartCrewManifest  newPCMtoUse 
)
inline

Adds a PartCrewManifest with the specified id. Removes the crew from the previous part if there was one using the specified id, then removes the part. Checks whether the crew in the new part are assigned to a previously used part and removes them from the new part if they are.

Parameters
idID to assign the new part.
newPCMtoUsePartCrewManifest to add.
VesselCrewManifest VesselCrewManifest.UpdateCrewForVessel ( ConfigNode  vesselNode,
System.Func< PartCrewManifest, bool >  persistFilter = null 
)
inline

Creates a new VesselCrewManifest from vesselNode. Then assigns the crew members from this VesselCrewManifest to the new VesselCrewManifest if they pass the persistFilter.

Parameters
vesselNodeConfigNode to create the new VesselCrewManifest from.
persistFilterFilter to apply to crew members. If they pass it, they get on the new VesselCrewManifest.
Returns
Returns a new VesselCrewManifest with all the crew members who have passed the persistFilter.
void VesselCrewManifest.UpdatePartManifest ( uint  id,
PartCrewManifest  referencePCM 
)
inline

Updates a PartCrewManifest with the specified id to have the crew members in the referencePCM. Removes the crew in the referencePCM from the previous assigned part if there was one. Then assigns the crew in the referencePCM to the part with the specified id.

Parameters
idCrew member to search for.
referencePCMCrew member to search for.

< just in case

Property Documentation

int VesselCrewManifest.CrewCount
get

Number of crew members in the vessel.

float VesselCrewManifest.CrewCountOptimizedForFloat
get

Number of crew members in the vessel. (Returned as a float)

int VesselCrewManifest.PartCount
get

Number of parts in the vessel.

List<PartCrewManifest> VesselCrewManifest.PartManifests
get

List of the parts in the vessel.


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