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

Class which represents a part and the crew members which are assigned to it. More...

Public Member Functions

void AddCrewToSeat (ProtoCrewMember crew, int seatIndex)
 Assigns a crew member to the specified seat. More...
 
bool AllSeatsEmpty ()
 Check whether all of the seats in the part are empty. More...
 
bool AllSeatsEmpty (KerbalRoster roster)
 Check whether all of the seats in the part are empty. More...
 
bool AnySeats ()
 Check whether there are any seats in this part. More...
 
bool AnySeatTaken ()
 Check whether anyone is sitting in any of the seats. More...
 
bool AnySeatTaken (KerbalRoster roster)
 Check whether anyone is sitting in any of the seats. More...
 
bool Contains (ProtoCrewMember crew)
 Check whether the PartCrewManifest contains a crew member. More...
 
int CountCrewNotType (ProtoCrewMember.KerbalType type)
 Counts the number of crew members who aren't of a specified type. More...
 
int CountCrewNotType (ProtoCrewMember.KerbalType type, KerbalRoster roster)
 Counts the number of crew members who aren't of a specified type. More...
 
int CountCrewType (ProtoCrewMember.KerbalType type)
 Counts the number of crew members with a specified type. More...
 
int CountCrewType (ProtoCrewMember.KerbalType type, KerbalRoster roster)
 Counts the number of crew members with a specified type. More...
 
int GetCrewSeat (ProtoCrewMember crew)
 Get the seat index for the seat that the crew member is occupying. More...
 
int GetCrewSeat (string name)
 Get the seat index for the seat that the crew member is occupying. More...
 
ProtoCrewMember[] GetPartCrew ()
 Get a list of the crew members seated in the part. More...
 
void GetPartCrew (ref ProtoCrewMember[] crewArray)
 Get a list of the crew members seated in the part. More...
 
bool NoSeats ()
 Check whether there are no seats in this part. More...
 
 PartCrewManifest (VesselCrewManifest v)
 Base constructor. More...
 
void RemoveCrew (string name)
 Removes the crew member with the specified name. More...
 
void RemoveCrewFromSeat (int seatIndex)
 Removes the crew member sitting at the specified seat. More...
 

Static Public Member Functions

static PartCrewManifest CloneOf (PartCrewManifest original, VesselCrewManifest vcm, bool blank)
 Clone a part crew manifest. More...
 
static PartCrewManifest FromConfigNode (ConfigNode node, VesselCrewManifest v)
 Generate a new PartCrewManifest based on a config node. More...
 

Public Attributes

string[] partCrew
 List of the crew members seated in this part. More...
 
VesselCrewManifest vcm
 The VesselCrewManifest which holds information about this part. More...
 

Properties

uint PartID [get]
 Part ID of this part. More...
 
AvailablePart PartInfo [get]
 Information about the part. More...
 

Detailed Description

Class which represents a part and the crew members which are assigned to it.

Constructor & Destructor Documentation

PartCrewManifest.PartCrewManifest ( VesselCrewManifest  v)
inline

Base constructor.

Parameters
vVesselCrewManifest which will contain this part.
Returns
The new PartCrewManifest.

Member Function Documentation

void PartCrewManifest.AddCrewToSeat ( ProtoCrewMember  crew,
int  seatIndex 
)
inline

Assigns a crew member to the specified seat.

Parameters
crewCrew member to be assigned.
seatIndexIndex of the seat to assign the crew member to.
bool PartCrewManifest.AllSeatsEmpty ( )
inline

Check whether all of the seats in the part are empty.

Returns
Returns true if all of the seats are empty, false if someone is occupying a seat.
bool PartCrewManifest.AllSeatsEmpty ( KerbalRoster  roster)
inline

Check whether all of the seats in the part are empty.

Parameters
rosterRoster to get the crew member information from.
Returns
Returns true if all of the seats are empty, false if someone is occupying a seat.
bool PartCrewManifest.AnySeats ( )
inline

Check whether there are any seats in this part.

Returns
Returns true if there are any seats, false if there are none.
bool PartCrewManifest.AnySeatTaken ( )
inline

Check whether anyone is sitting in any of the seats.

Returns
Returns true if anyone is seated in the part, false if the part is empty.
bool PartCrewManifest.AnySeatTaken ( KerbalRoster  roster)
inline

Check whether anyone is sitting in any of the seats.

Parameters
rosterRoster to get the crew member information from.
Returns
Returns true if anyone is seated in the part, false if the part is empty.
static PartCrewManifest PartCrewManifest.CloneOf ( PartCrewManifest  original,
VesselCrewManifest  vcm,
bool  blank 
)
inlinestatic

Clone a part crew manifest.

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

Check whether the PartCrewManifest contains a crew member.

Parameters
crewCrew member to search for.
Returns
Returns true if crew member is in the PartCrewManifest, false if the crew member isn't.
int PartCrewManifest.CountCrewNotType ( ProtoCrewMember.KerbalType  type)
inline

Counts the number of crew members who aren't of a specified type.

Parameters
typeType to check for.
Returns
Returns the number of crew members who aren't of a specified type. Empty seats won't affect the count.
int PartCrewManifest.CountCrewNotType ( ProtoCrewMember.KerbalType  type,
KerbalRoster  roster 
)
inline

Counts the number of crew members who aren't of a specified type.

Parameters
typeType to check for.
rosterRoster to get the crew member information from.
Returns
Returns the number of crew members who aren't of a specified type. Empty seats won't affect the count.
int PartCrewManifest.CountCrewType ( ProtoCrewMember.KerbalType  type)
inline

Counts the number of crew members with a specified type.

Parameters
typeType to check for.
Returns
Returns the number of crew members with a specified type.
int PartCrewManifest.CountCrewType ( ProtoCrewMember.KerbalType  type,
KerbalRoster  roster 
)
inline

Counts the number of crew members with a specified type.

Parameters
typeType to check for.
rosterRoster to get the crew member information from.
Returns
Returns the number of crew members with a specified type. Empty seats won't affect the count.
static PartCrewManifest PartCrewManifest.FromConfigNode ( ConfigNode  node,
VesselCrewManifest  v 
)
inlinestatic

Generate a new PartCrewManifest based on a config node.

Parameters
nodeNode representing the part
vVesselCrewManifest which will contain this part.
Returns
Returns a new PartCrewManifest based on a config node.
int PartCrewManifest.GetCrewSeat ( ProtoCrewMember  crew)
inline

Get the seat index for the seat that the crew member is occupying.

Parameters
crewCrew member to search for.
Returns
Returns the seat index for the seat that the crew member is occupying.
int PartCrewManifest.GetCrewSeat ( string  name)
inline

Get the seat index for the seat that the crew member is occupying.

Parameters
nameName of the crew member to search for.
Returns
Returns the seat index for the seat that the crew member is occupying.
ProtoCrewMember [] PartCrewManifest.GetPartCrew ( )
inline

Get a list of the crew members seated in the part.

Returns
Returns a list of the crew members seated in the part. Empty seats will have null pointer slots in the array.
void PartCrewManifest.GetPartCrew ( ref ProtoCrewMember[]  crewArray)
inline

Get a list of the crew members seated in the part.

Parameters
crewArrayArray in which to put the list of crew members.
bool PartCrewManifest.NoSeats ( )
inline

Check whether there are no seats in this part.

Returns
Returns true if there are no seats, false if there are any.
void PartCrewManifest.RemoveCrew ( string  name)
inline

Removes the crew member with the specified name.

Parameters
nameName of the crew member to be removed.
void PartCrewManifest.RemoveCrewFromSeat ( int  seatIndex)
inline

Removes the crew member sitting at the specified seat.

Parameters
seatIndexIndex of the seat to remove the crew member from.

Member Data Documentation

string [] PartCrewManifest.partCrew

List of the crew members seated in this part.

VesselCrewManifest PartCrewManifest.vcm

The VesselCrewManifest which holds information about this part.

Property Documentation

uint PartCrewManifest.PartID
get

Part ID of this part.

AvailablePart PartCrewManifest.PartInfo
get

Information about the part.


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