Resources¶
- class Resources¶
Represents the collection of resources stored in a vessel, stage or part. Created by calling
Vessel.Resources
,Vessel.ResourcesInDecoupleStage
orPart.Resources
.- IList<Resource> WithResource (String name)¶
All the individual resources with the given name that can be stored.
- Parameters:
- Game Scenes:
Flight
- Boolean HasResource (String name)¶
Check whether the named resource can be stored.
- Parameters:
name – The name of the resource.
- Game Scenes:
Flight
- Single Amount (String name)¶
Returns the amount of a resource that is currently stored.
- Parameters:
name – The name of the resource.
- Game Scenes:
Flight
- Single Max (String name)¶
Returns the amount of a resource that can be stored.
- Parameters:
name – The name of the resource.
- Game Scenes:
Flight
- static Single Density (IConnection connection, String name)¶
Returns the density of a resource, in \(kg/l\).
- Parameters:
name – The name of the resource.
- Game Scenes:
Flight
- static ResourceFlowMode FlowMode (IConnection connection, String name)¶
Returns the flow mode of a resource.
- Parameters:
name – The name of the resource.
- Game Scenes:
Flight
- class Resource¶
An individual resource stored within a part. Created using methods in the
Resources
class.- Single Amount { get; }¶
The amount of the resource that is currently stored in the part.
- Game Scenes:
All
- Single Max { get; }¶
The total amount of the resource that can be stored in the part.
- Game Scenes:
All
- ResourceFlowMode FlowMode { get; }¶
The flow mode of the resource.
- Game Scenes:
All
- class ResourceTransfer¶
Transfer resources between parts.
- static ResourceTransfer Start (IConnection connection, Part fromPart, Part toPart, String resource, Single maxAmount)¶
Start transferring a resource transfer between a pair of parts. The transfer will move at most maxAmount units of the resource, depending on how much of the resource is available in the source part and how much storage is available in the destination part. Use
ResourceTransfer.Complete
to check if the transfer is complete. UseResourceTransfer.Amount
to see how much of the resource has been transferred.- Parameters:
fromPart – The part to transfer to.
toPart – The part to transfer from.
resource – The name of the resource to transfer.
maxAmount – The maximum amount of resource to transfer.
- Game Scenes:
All
- enum ResourceFlowMode¶
The way in which a resource flows between parts. See
Resources.FlowMode
.- Vessel¶
The resource flows to any part in the vessel. For example, electric charge.
- Stage¶
The resource flows from parts in the first stage, followed by the second, and so on. For example, mono-propellant.
- Adjacent¶
The resource flows between adjacent parts within the vessel. For example, liquid fuel or oxidizer.
- None¶
The resource does not flow. For example, solid fuel.