C# Class SSTUTools.SSTUModelSwitch

Inheritance: PartModule, IPartMassModifier, IPartCostModifier
Datei anzeigen Open project: shadowmage45/SSTULabs Class Usage Examples

Public Methods

Method Description
GetModuleCost ( float defaultCost, ModifierStagingSituation sit ) : float
GetModuleCostChangeWhen ( ) : ModifierChangeWhen
GetModuleMass ( float defaultMass, ModifierStagingSituation sit ) : float
GetModuleMassChangeWhen ( ) : ModifierChangeWhen
OnLoad ( ConfigNode node ) : void
OnSave ( ConfigNode node ) : void
OnStart ( StartState state ) : void
Start ( ) : void
findGroup ( string name ) : ModelSwitchGroup

Locate the modelSwitchGroup for the input name -- UNSAFE - will KNFE for invalid name

onGroupUpdated ( BaseField field, object obj ) : void
onModelUpdated ( BaseField field, object obj ) : void

Private Methods

Method Description
calcTotalVolume ( ) : float

Calculates the total allocated volume for ALL VolumeContianer sub-containers This is calculated as -liters-

calcVolume ( int containerIndex ) : float

Calculates the total allocated volume for a specific container index. This is calculated as -liters-

initialize ( ) : void

Initialize this module - load config data, restore persistent data, setup gui fields

updateAttachNodes ( bool userInput ) : void
updateAttachNodesForModel ( ModelSwitchData modelData ) : void
updateContainerVolume ( ) : void

Updates the associated VolumeContainer with any changes to part volume from this module

updateDragCube ( ) : void
updateGui ( ) : void

Update the currently avaialble selection options and enabled/disabled status of the group and model selection widgets

updateMassAndCost ( ) : void

Update the cached mass and cost for the -models- that are currently enabled; resources and tankage are handled by VolumeContainer

updatePersistentData ( ) : void

Update the persistent data field with the current configuration for this module; this is a set of enabled/disabled flags for each groups models

Method Details

GetModuleCost() public method

public GetModuleCost ( float defaultCost, ModifierStagingSituation sit ) : float
defaultCost float
sit ModifierStagingSituation
return float

GetModuleCostChangeWhen() public method

public GetModuleCostChangeWhen ( ) : ModifierChangeWhen
return ModifierChangeWhen

GetModuleMass() public method

public GetModuleMass ( float defaultMass, ModifierStagingSituation sit ) : float
defaultMass float
sit ModifierStagingSituation
return float

GetModuleMassChangeWhen() public method

public GetModuleMassChangeWhen ( ) : ModifierChangeWhen
return ModifierChangeWhen

OnLoad() public method

public OnLoad ( ConfigNode node ) : void
node System.ConfigNode
return void

OnSave() public method

public OnSave ( ConfigNode node ) : void
node System.ConfigNode
return void

OnStart() public method

public OnStart ( StartState state ) : void
state StartState
return void

Start() public method

public Start ( ) : void
return void

findGroup() public method

Locate the modelSwitchGroup for the input name -- UNSAFE - will KNFE for invalid name
public findGroup ( string name ) : ModelSwitchGroup
name string
return ModelSwitchGroup

onGroupUpdated() public method

public onGroupUpdated ( BaseField field, object obj ) : void
field BaseField
obj object
return void

onModelUpdated() public method

public onModelUpdated ( BaseField field, object obj ) : void
field BaseField
obj object
return void