-
Notifications
You must be signed in to change notification settings - Fork 14
BaseResourceProcessor
This is the base class for a resource processor. Similar to ModuleResourceConverter, the consumer will consume resources and produce resources, but it happens at the vessel level, not the part level. It's also designed to work with both loaded and unloaded vessels. Another important difference is that consumed/produced resources can occur on a per crewmember basis; a vessel with 5 crew will consume and/or produce 5 times the resources as a vessel with 1 crewmember. The configuration of a BaseResourceProcessor is done through config files.
Name of the resource processor
Number of seconds that must pass before running the consumer.
Handles the situation where the kerbal went on EVA.
astronaut: The kerbal that went on EVA.
part: The part that the kerbal left.
Handles the situation where a kerbal boards a vessel.
astronaut: The kerbal boarding a vessel.
part: The part boarded.
Handles adding of a new kerbal, giving the consumer a chance to add custom roster data.
astronaut: The kerbal being added.
Handles removal of a kerbal, giving the consumer a chance to update custom data if needed.
astronaut: The kerbal being removed.
Handles a kerbal's name change.
astronaut: The kerbal whose name has changed. Note that roster data is already being carried over, this event is used to give consumers a chance to update custom data kept outside of the roster.
previousName: The kerbal's previous name.
newName: The kerbal's new name.
Handles vessel loaded event, for instance, adding resources that should be on the vessel.
vessel: The vessel that was loaded.
Handles the vessel recovery event
protoVessel: The ProtoVessel being recovered
Handles the situation where the vessel goes off rails.
vessel: The Vessel going off rails
Handles changes to game settings.
Loads the SNACKS_RESOURCE_PROCESSOR config nodes and returns a list of processors.
A list of resource processors.
Initializes the consumer
Cleanup as processor is about to be destroyed
De-serializes persistence data
node: The ConfigNode with the persistence data
Saves persistence data to a ConfigNode and returns it.
A ConfigNode containing persistence data, if any.
AddConsumedAndProducedResources(Vessel,System.Double,System.Collections.Generic.List{ResourceRatio},System.Collections.Generic.List{ResourceRatio})
Used primarily for simulations, returns the consumed and produced resources for the given unit of time.
vessel: The vessel to query for data.
secondsPerCycle: The number of seconds to calculate total inputs and outputs.
consumedResources: The list of consumed resources to add the inputs to.
producedResources: The list of produced resources to add the outputs to.
AddConsumedAndProducedResources(System.Int32,System.Double,System.Collections.Generic.List{ResourceRatio},System.Collections.Generic.List{ResourceRatio})
Used primarily for simulations, returns the consumed and produced resources for the given unit of time.
crewCount: The number of crew to simulate.
secondsPerCycle: The number of seconds to calculate total inputs and outputs.
consumedResources: The list of consumed resources to add the inputs to.
producedResources: The list of produced resources to add the outputs to.
Returns the amount and max amount of the desired resource in the unloaded vessel.
protoVessel: The vessel to query for the resource totals.
resourceName: The name of the resource to query.
amount: The amount of the resource that the entire vessel has.
maxAmount: The max amount of the resource that the entire vessel has.
Runs the processor, consuming input resources, producing output resources, and collating results.
vessel: The vessel to run the consumer on.
elapsedTime: Number of seconds that have passed.
crewCount: Number of crew aboard the vessel.
crewCapacity: The vessel's total crew capacity.