Show / Hide Table of Contents

Class MyResourceSourceComponent

Inheritance
System.Object
MyComponentBase
MyEntityComponentBase
MyResourceSourceComponentBase
MyResourceSourceComponent
Inherited Members
MyEntityComponentBase.OnAddedToContainer()
MyEntityComponentBase.OnBeforeRemovedFromContainer()
MyEntityComponentBase.Container
MyEntityComponentBase.Entity
MyEntityComponentBase.AttachSyncToEntity
MyEntityComponentBase.OnAfterAddedToContainer
MyEntityComponentBase.BeforeRemovedFromContainer
MyComponentBase.SetContainer(IMyComponentContainer)
MyComponentBase.GetAs<T>()
MyComponentBase.OnAddedToScene()
MyComponentBase.OnRemovedFromScene()
MyComponentBase.Serialize(Boolean)
MyComponentBase.Deserialize(MyObjectBuilder_ComponentBase)
MyComponentBase.Init(MyComponentDefinitionBase)
MyComponentBase.IsSerialized()
MyComponentBase.RemoveExistingComponentOnNewInsert
MyComponentBase.ContainerBase
Namespace: Sandbox.Game.EntityComponents
Assembly: Sandbox.Game.dll
Syntax
public class MyResourceSourceComponent : MyResourceSourceComponentBase, IMyEntityComponentBase, IMyComponentBase

Constructors

MyResourceSourceComponent(Int32)

Declaration
public MyResourceSourceComponent(int initialAllocationSize = 1)
Parameters
Type Name Description
System.Int32 initialAllocationSize

Fields

CountTowardsRemainingEnergyTime

Declaration
public bool CountTowardsRemainingEnergyTime
Field Value
Type Description
System.Boolean

Properties

ComponentTypeDebugString

Declaration
public override string ComponentTypeDebugString { get; }
Property Value
Type Description
System.String
Overrides
MyEntityComponentBase.ComponentTypeDebugString

CurrentOutput

Declaration
public float CurrentOutput { get; }
Property Value
Type Description
System.Single

DefinedOutput

Declaration
public float DefinedOutput { get; }
Property Value
Type Description
System.Single

Enabled

Declaration
public bool Enabled { get; set; }
Property Value
Type Description
System.Boolean

Grid

Declaration
public MyCubeGrid Grid { get; set; }
Property Value
Type Description
MyCubeGrid

Group

Declaration
public MyStringHash Group { get; }
Property Value
Type Description
MyStringHash

HasCapacityRemaining

Declaration
public bool HasCapacityRemaining { get; }
Property Value
Type Description
System.Boolean

IsInfiniteCapacity

Declaration
public bool IsInfiniteCapacity { get; }
Property Value
Type Description
System.Boolean

MaxOutput

Declaration
public float MaxOutput { get; }
Property Value
Type Description
System.Single

ProductionEnabled

Declaration
public bool ProductionEnabled { get; }
Property Value
Type Description
System.Boolean

ProductionToCapacityMultiplier

Declaration
public float ProductionToCapacityMultiplier { get; }
Property Value
Type Description
System.Single

RemainingCapacity

Declaration
public float RemainingCapacity { get; }
Property Value
Type Description
System.Single

ResourceTypes

Declaration
public ListReader<MyDefinitionId> ResourceTypes { get; }
Property Value
Type Description
ListReader<MyDefinitionId>

TemporaryConnectedEntity

Declaration
public MyEntity TemporaryConnectedEntity { get; set; }
Property Value
Type Description
MyEntity

Methods

add_HasCapacityRemainingChanged(MyResourceCapacityRemainingChangedDelegate)

Declaration
public void add_HasCapacityRemainingChanged(MyResourceCapacityRemainingChangedDelegate value)
Parameters
Type Name Description
MyResourceCapacityRemainingChangedDelegate value

add_MaxOutputChanged(MyResourceOutputChangedDelegate)

Declaration
public void add_MaxOutputChanged(MyResourceOutputChangedDelegate value)
Parameters
Type Name Description
MyResourceOutputChangedDelegate value

add_OutputChanged(MyResourceOutputChangedDelegate)

Declaration
public void add_OutputChanged(MyResourceOutputChangedDelegate value)
Parameters
Type Name Description
MyResourceOutputChangedDelegate value

add_ProductionEnabledChanged(MyResourceCapacityRemainingChangedDelegate)

Declaration
public void add_ProductionEnabledChanged(MyResourceCapacityRemainingChangedDelegate value)
Parameters
Type Name Description
MyResourceCapacityRemainingChangedDelegate value

CurrentOutputByType(MyDefinitionId)

Declaration
public override float CurrentOutputByType(MyDefinitionId resourceTypeId)
Parameters
Type Name Description
MyDefinitionId resourceTypeId
Returns
Type Description
System.Single
Overrides
MyResourceSourceComponentBase.CurrentOutputByType(MyDefinitionId)

DebugDraw(Matrix)

Declaration
public void DebugDraw(Matrix worldMatrix)
Parameters
Type Name Description
Matrix worldMatrix

DefinedOutputByType(MyDefinitionId)

Declaration
public override float DefinedOutputByType(MyDefinitionId resourceTypeId)
Parameters
Type Name Description
MyDefinitionId resourceTypeId
Returns
Type Description
System.Single
Overrides
MyResourceSourceComponentBase.DefinedOutputByType(MyDefinitionId)

GetTypeIndex(MyDefinitionId)

Declaration
protected int GetTypeIndex(MyDefinitionId resourceTypeId)
Parameters
Type Name Description
MyDefinitionId resourceTypeId
Returns
Type Description
System.Int32

HasCapacityRemainingByType(MyDefinitionId)

Declaration
public bool HasCapacityRemainingByType(MyDefinitionId resourceTypeId)
Parameters
Type Name Description
MyDefinitionId resourceTypeId
Returns
Type Description
System.Boolean

Init(MyStringHash, MyResourceSourceInfo)

Declaration
public void Init(MyStringHash sourceGroup, MyResourceSourceInfo sourceResourceData)
Parameters
Type Name Description
MyStringHash sourceGroup
MyResourceSourceInfo sourceResourceData

Init(MyStringHash, List<MyResourceSourceInfo>)

Declaration
public void Init(MyStringHash sourceGroup, List<MyResourceSourceInfo> sourceResourceData)
Parameters
Type Name Description
MyStringHash sourceGroup
System.Collections.Generic.List<MyResourceSourceInfo> sourceResourceData

MaxOutputByType(MyDefinitionId)

Declaration
public override float MaxOutputByType(MyDefinitionId resourceTypeId)
Parameters
Type Name Description
MyDefinitionId resourceTypeId
Returns
Type Description
System.Single
Overrides
MyResourceSourceComponentBase.MaxOutputByType(MyDefinitionId)

OnProductionEnabledChanged(Nullable<MyDefinitionId>)

Do not use this unless absolutely necessary.

Declaration
public void OnProductionEnabledChanged(Nullable<MyDefinitionId> resId = null)
Parameters
Type Name Description
System.Nullable<MyDefinitionId> resId

ProductionEnabledByType(MyDefinitionId)

Declaration
public override bool ProductionEnabledByType(MyDefinitionId resourceTypeId)
Parameters
Type Name Description
MyDefinitionId resourceTypeId
Returns
Type Description
System.Boolean
Overrides
MyResourceSourceComponentBase.ProductionEnabledByType(MyDefinitionId)

ProductionToCapacityMultiplierByType(MyDefinitionId)

Declaration
public float ProductionToCapacityMultiplierByType(MyDefinitionId resourceTypeId)
Parameters
Type Name Description
MyDefinitionId resourceTypeId
Returns
Type Description
System.Single

RemainingCapacityByType(MyDefinitionId)

Declaration
public float RemainingCapacityByType(MyDefinitionId resourceTypeId)
Parameters
Type Name Description
MyDefinitionId resourceTypeId
Returns
Type Description
System.Single

remove_HasCapacityRemainingChanged(MyResourceCapacityRemainingChangedDelegate)

Declaration
public void remove_HasCapacityRemainingChanged(MyResourceCapacityRemainingChangedDelegate value)
Parameters
Type Name Description
MyResourceCapacityRemainingChangedDelegate value

remove_MaxOutputChanged(MyResourceOutputChangedDelegate)

Declaration
public void remove_MaxOutputChanged(MyResourceOutputChangedDelegate value)
Parameters
Type Name Description
MyResourceOutputChangedDelegate value

remove_OutputChanged(MyResourceOutputChangedDelegate)

Declaration
public void remove_OutputChanged(MyResourceOutputChangedDelegate value)
Parameters
Type Name Description
MyResourceOutputChangedDelegate value

remove_ProductionEnabledChanged(MyResourceCapacityRemainingChangedDelegate)

Declaration
public void remove_ProductionEnabledChanged(MyResourceCapacityRemainingChangedDelegate value)
Parameters
Type Name Description
MyResourceCapacityRemainingChangedDelegate value

SetMaxOutput(Single)

Declaration
public void SetMaxOutput(float newMaxOutput)
Parameters
Type Name Description
System.Single newMaxOutput

SetMaxOutputByType(MyDefinitionId, Single)

Declaration
public void SetMaxOutputByType(MyDefinitionId resourceTypeId, float newMaxOutput)
Parameters
Type Name Description
MyDefinitionId resourceTypeId
System.Single newMaxOutput

SetOutput(Single)

Declaration
public void SetOutput(float newOutput)
Parameters
Type Name Description
System.Single newOutput

SetOutputByType(MyDefinitionId, Single)

Declaration
public void SetOutputByType(MyDefinitionId resourceTypeId, float newOutput)
Parameters
Type Name Description
MyDefinitionId resourceTypeId
System.Single newOutput

SetProductionEnabledByType(MyDefinitionId, Boolean)

Declaration
public void SetProductionEnabledByType(MyDefinitionId resourceTypeId, bool newProducerEnabled)
Parameters
Type Name Description
MyDefinitionId resourceTypeId
System.Boolean newProducerEnabled

SetRemainingCapacityByType(MyDefinitionId, Single)

Declaration
public void SetRemainingCapacityByType(MyDefinitionId resourceTypeId, float newRemainingCapacity)
Parameters
Type Name Description
MyDefinitionId resourceTypeId
System.Single newRemainingCapacity

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String

Events

HasCapacityRemainingChanged

Declaration
public event MyResourceCapacityRemainingChangedDelegate HasCapacityRemainingChanged
Event Type
Type Description
MyResourceCapacityRemainingChangedDelegate

MaxOutputChanged

Declaration
public event MyResourceOutputChangedDelegate MaxOutputChanged
Event Type
Type Description
MyResourceOutputChangedDelegate

OutputChanged

Declaration
public event MyResourceOutputChangedDelegate OutputChanged
Event Type
Type Description
MyResourceOutputChangedDelegate

ProductionEnabledChanged

Declaration
public event MyResourceCapacityRemainingChangedDelegate ProductionEnabledChanged
Event Type
Type Description
MyResourceCapacityRemainingChangedDelegate

Extension Methods

MyEntityContainerEventExtensions.RegisterForEntityEvent(MyEntityComponentBase, MyStringHash, MyEntityContainerEventExtensions.EntityEventHandler)
MyEntityContainerEventExtensions.RegisterForEntityEvent(MyEntityComponentBase, MyEntity, MyStringHash, MyEntityContainerEventExtensions.EntityEventHandler)
MyEntityContainerEventExtensions.UnregisterForEntityEvent(MyEntityComponentBase, MyEntity, MyStringHash)
MyEntityContainerEventExtensions.RaiseEntityEvent(MyEntityComponentBase, MyStringHash, MyEntityContainerEventExtensions.EntityEventParams)
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾