Kerbal Space Program
1.12.4
|
A subclass of PartModule to handle ModuleResource-limited PartModules. More...
Public Member Functions | |
virtual double | GetAverageInput () |
Gets the average input rate (or 0 if 0 inputs) More... | |
bool | HasEnoughResourcesToAutoStart () |
Determines if there are currently enough resources in the vessel to auto-start if that behavior is activated More... | |
bool | IsResourceBelowShutOffLimit (PartResource partRes) |
Determines if there are currently enough resources in the vessel to keep operating if using auto-shutoff behavior More... | |
virtual void | OnAwake () |
virtual void | OnLoad (ConfigNode node) |
virtual string | PrintModuleResources (double mult=1d) |
Returns a pretty-formatted string containing all resources and rates More... | |
virtual string | PrintModuleResources (bool showFlowModeDesc, double mult=1d) |
Returns a pretty-formatted string containing all resources and rates More... | |
void | SetPartModule (PartModule p) |
virtual double | UpdateModuleResourceInputs (ref string error, double rateMultiplier, double threshold, bool returnOnFirstLack, bool average, bool stringOps=true) |
Updates the input resource state, requesting all resources and reporting a lack if any as the min fraction available (or 0 if returnOnFirstLack is true) More... | |
virtual double | UpdateModuleResourceInputs (ref string error, bool useFlowMode, double rateMultiplier, double threshold, bool returnOnFirstLack, bool average, bool stringOps=true) |
Updates the input resource state, requesting all resources and reporting a lack if any as the min fraction available (or 0 if returnOnFirstLack is true) More... | |
virtual bool | UpdateModuleResourceInputs (ref string error, bool useFlowMode, double rateMultiplier, double threshold, bool returnOnFirstLack, bool stringOps=true) |
Updates the input resource state, requesting all resources and reporting a lack if any More... | |
virtual bool | UpdateModuleResourceInputs (ref string error, double rateMultiplier, double threshold, bool returnOnFirstLack, bool stringOps=true) |
Updates the input resource state, requesting all resources and reporting a lack if any More... | |
virtual double | UpdateModuleResourceOutputs (double rateMultiplier=1d, double minAbsValue=0d) |
Updates the output resources, pushing the resources out More... | |
Public Attributes | |
bool | currentResourceLowerThanLayoff |
List< ModuleResource > | inputResources = new List<ModuleResource>() |
bool | moduleResourceBasedPrimaryIsInput = true |
List< ModuleResource > | outputResources = new List<ModuleResource>() |
PartModule | partModule |
Protected Member Functions | |
void | LoadResList (List< ModuleResource > list, ConfigNode node) |
A subclass of PartModule to handle ModuleResource-limited PartModules.
|
inlinevirtual |
Gets the average input rate (or 0 if 0 inputs)
|
inline |
Determines if there are currently enough resources in the vessel to auto-start if that behavior is activated
|
inline |
Determines if there are currently enough resources in the vessel to keep operating if using auto-shutoff behavior
partRes | The PartResource to test for amount and limits |
|
inlineprotected |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Returns a pretty-formatted string containing all resources and rates
mult | multiplier to the bas rate |
|
inlinevirtual |
Returns a pretty-formatted string containing all resources and rates
showFlowModeDesc | If true will also include a flow mode description for each resource. |
mult | multiplier to the bas rate |
|
inline |
|
inlinevirtual |
Updates the input resource state, requesting all resources and reporting a lack if any as the min fraction available (or 0 if returnOnFirstLack is true)
error | the string to write the lack to |
rateMultiplier | a multiplier to the resource request |
threshold | the threshold multiplier below which the resource will be considered lacking |
returnOnFirstLack | if true, will report the first lacking resource, else will report all resources lacking |
average | do we average the returned values or clamp to the lowest? Obviously false if returnOnFirstLack |
stringOps | Do we write errors to the string? |
|
inlinevirtual |
Updates the input resource state, requesting all resources and reporting a lack if any as the min fraction available (or 0 if returnOnFirstLack is true)
error | the string to write the lack to |
useFlowMode | If True will use flowMode defined in inputResources, If false will use the Default flowMode. |
rateMultiplier | a multiplier to the resource request |
threshold | the threshold multiplier below which the resource will be considered lacking |
returnOnFirstLack | if true, will report the first lacking resource, else will report all resources lacking |
average | do we average the returned values or clamp to the lowest? Obviously false if returnOnFirstLack |
stringOps | Do we write errors to the string? |
|
inlinevirtual |
Updates the input resource state, requesting all resources and reporting a lack if any
error | the string to write the lack to |
useFlowMode | If True will use flowMode defined in inputResources, If false will use the Default flowMode. |
rateMultiplier | a multiplier to the resource request |
threshold | the threshold multiplier below which the resource will be considered lacking |
returnOnFirstLack | if true, will report the first lacking resource, else will report all resources lacking |
stringOps | Do we write errors to the string? |
|
inlinevirtual |
Updates the input resource state, requesting all resources and reporting a lack if any
error | the string to write the lack to |
rateMultiplier | a multiplier to the resource request |
threshold | the threshold multiplier below which the resource will be considered lacking |
returnOnFirstLack | if true, will report the first lacking resource, else will report all resources lacking |
stringOps | Do we write errors to the string? |
|
inlinevirtual |
Updates the output resources, pushing the resources out
rateMultiplier | a multiplier to the resource requests |
minAbsValue | the minimum single-tick value pushed out to the network |
bool ModuleResourceHandler.currentResourceLowerThanLayoff |
List<ModuleResource> ModuleResourceHandler.inputResources = new List<ModuleResource>() |
bool ModuleResourceHandler.moduleResourceBasedPrimaryIsInput = true |
List<ModuleResource> ModuleResourceHandler.outputResources = new List<ModuleResource>() |
PartModule ModuleResourceHandler.partModule |