Interface IMyResourceDistributorComponent
ModAPI interface giving access to resource distributor
Namespace: VRage.Game.ModAPI
Assembly: VRage.Game.dll
Syntax
public interface IMyResourceDistributorComponent
Properties
ResourceState
Gets current resource state
Declaration
MyResourceStateEnum ResourceState { get; }
Property Value
Type | Description |
---|---|
VRage.MyResourceStateEnum |
SourcesEnabled
Gets if first found resources has enabled ResourceSource
Declaration
MyMultipleEnabledEnum SourcesEnabled { get; }
Property Value
Type | Description |
---|---|
VRage.MyMultipleEnabledEnum |
Methods
MaxAvailableResourceByType(MyDefinitionId, IMyCubeGrid)
Gets maximum resource available by resource type
Declaration
float MaxAvailableResourceByType(MyDefinitionId resourceTypeId, IMyCubeGrid grid = null)
Parameters
Type | Name | Description |
---|---|---|
MyDefinitionId | resourceTypeId | Resource type. Ex: MyResourceDistributorComponent.ElectricityId |
IMyCubeGrid | grid | Should be not null for electricity |
Returns
Type | Description |
---|---|
System.Single | Available resource, or 0 |
TotalRequiredInputByType(MyDefinitionId, IMyCubeGrid)
Gets currently needed resource by resource type
Declaration
float TotalRequiredInputByType(MyDefinitionId resourceTypeId, IMyCubeGrid grid = null)
Parameters
Type | Name | Description |
---|---|---|
MyDefinitionId | resourceTypeId | Resource type. Ex: MyResourceDistributorComponent.ElectricityId |
IMyCubeGrid | grid | Should be not null for electricity |
Returns
Type | Description |
---|---|
System.Single | Available resource, or 0 |
Events
OnPowerGenerationChanged
Called when power generation status changed
Declaration
event Action<bool> OnPowerGenerationChanged
Event Type
Type | Description |
---|---|
System.Action<System.Boolean> |