Space Engineers
Classes | Public Member Functions | Public Attributes | Protected Member Functions | Properties | Events | List of all members
Sandbox.Game.EntityComponents.MyResourceSinkComponent Class Reference
Inheritance diagram for Sandbox.Game.EntityComponents.MyResourceSinkComponent:
VRage.Game.Components.MyResourceSinkComponentBase VRage.Game.Components.MyEntityComponentBase VRage.Game.Components.MyComponentBase

Public Member Functions

 MyResourceSinkComponent (int initialAllocationSize=1)
 
void Init (MyStringHash group, float maxRequiredInput, Func< float > requiredInputFunc)
 
void Init (MyStringHash group, MyResourceSinkInfo sinkData)
 
void Init (MyStringHash group, List< MyResourceSinkInfo > sinkData)
 
void AddType (ref MyResourceSinkInfo sinkData)
 
void RemoveType (ref MyDefinitionId resourceType)
 
override void SetInputFromDistributor (MyDefinitionId resourceTypeId, float newResourceInput, bool isAdaptible, bool fireEvents=true)
 This should be called only from MyResourceDistributor. More...
 
override bool IsPowerAvailable (MyDefinitionId resourceTypeId, float power)
 
void Update ()
 
override float MaxRequiredInputByType (MyDefinitionId resourceTypeId)
 
override void SetMaxRequiredInputByType (MyDefinitionId resourceTypeId, float newMaxRequiredInput)
 
override float CurrentInputByType (MyDefinitionId resourceTypeId)
 
override float RequiredInputByType (MyDefinitionId resourceTypeId)
 
override bool IsPoweredByType (MyDefinitionId resourceTypeId)
 
override void SetRequiredInputByType (MyDefinitionId resourceTypeId, float newRequiredInput)
 
override void SetRequiredInputFuncByType (MyDefinitionId resourceTypeId, Func< float > newRequiredInputFunc)
 Change the required input function (callback) for given type of resource. It does not call it immediatelly to update required input value. More...
 
override float SuppliedRatioByType (MyDefinitionId resourceTypeId)
 
void DebugDraw (Matrix worldMatrix)
 
- Public Member Functions inherited from VRage.Game.Components.MyEntityComponentBase
override void OnAddedToContainer ()
 Gets called after the container of this component changes More...
 
override void OnBeforeRemovedFromContainer ()
 Gets called before the removal of this component from a container More...
 
- Public Member Functions inherited from VRage.Game.Components.MyComponentBase
virtual void SetContainer (MyComponentContainer container)
 Sets the container of this component. Note that the component is not added to the container here! Therefore, use MyComponentContainer.Add(...) method and it will in turn call this method. Actually, you should seldom have the need to call this method yourself. More...
 
virtual T GetAs< T > ()
 
virtual void OnAddedToScene ()
 CH: TOOD: Be careful! This does not get called if the component is added to a container that is in the scene already! More...
 
virtual void OnRemovedFromScene ()
 CH: TOOD: Be careful! This does not get called if the component is removed from a container that is still in the scene! More...
 
virtual MyObjectBuilder_ComponentBase Serialize (bool copy=false)
 
virtual void Deserialize (MyObjectBuilder_ComponentBase builder)
 
virtual void Init (MyComponentDefinitionBase definition)
 
virtual bool IsSerialized ()
 Tells the component container serializer whether this component should be saved More...
 

Public Attributes

MyCurrentResourceInputChangedDelegate CurrentInputChanged
 

Protected Member Functions

int GetTypeIndex (MyDefinitionId resourceTypeId)
 

Properties

override IMyEntity TemporaryConnectedEntity [get, set]
 
new MyEntity Entity [get]
 
float MaxRequiredInput [get, set]
 
float RequiredInput [get]
 
float SuppliedRatio [get]
 
float CurrentInput [get]
 
bool IsPowered [get]
 
override ListReader< MyDefinitionIdAcceptedResources [get]
 
override string ComponentTypeDebugString [get]
 
- Properties inherited from VRage.Game.Components.MyResourceSinkComponentBase
abstract ListReader< MyDefinitionIdAcceptedResources [get]
 
abstract IMyEntity TemporaryConnectedEntity [get, set]
 
- Properties inherited from VRage.Game.Components.MyEntityComponentBase
MyEntityComponentContainer Container [get]
 
IMyEntity Entity [get]
 
abstract string ComponentTypeDebugString [get]
 Name of the base component type for debug purposes (e.g.: "Position") More...
 
- Properties inherited from VRage.Game.Components.MyComponentBase
MyComponentContainer ContainerBase [get]
 This cannot be named Container to not conflict with the definition of Container in MyEntityComponentBase. More...
 

Events

MyRequiredResourceChangeDelegate RequiredInputChanged
 
MyResourceAvailableDelegate ResourceAvailable
 
Action IsPoweredChanged
 
Action< MyResourceSinkComponent, MyDefinitionIdOnAddType
 
Action< MyResourceSinkComponent, MyDefinitionIdOnRemoveType
 
- Events inherited from VRage.Game.Components.MyEntityComponentBase
static Action< MyEntityComponentBaseOnAfterAddedToContainer
 
Action< MyEntityComponentBaseBeforeRemovedFromContainer
 

Detailed Description

Definition at line 23 of file MyResourceSinkComponent.cs.

Constructor & Destructor Documentation

Sandbox.Game.EntityComponents.MyResourceSinkComponent.MyResourceSinkComponent ( int  initialAllocationSize = 1)
inline

Definition at line 102 of file MyResourceSinkComponent.cs.

Member Function Documentation

void Sandbox.Game.EntityComponents.MyResourceSinkComponent.AddType ( ref MyResourceSinkInfo  sinkData)
inline

Definition at line 145 of file MyResourceSinkComponent.cs.

override float Sandbox.Game.EntityComponents.MyResourceSinkComponent.CurrentInputByType ( MyDefinitionId  resourceTypeId)
inlinevirtual
void Sandbox.Game.EntityComponents.MyResourceSinkComponent.DebugDraw ( Matrix  worldMatrix)
inline

Definition at line 327 of file MyResourceSinkComponent.cs.

int Sandbox.Game.EntityComponents.MyResourceSinkComponent.GetTypeIndex ( MyDefinitionId  resourceTypeId)
inlineprotected

Definition at line 308 of file MyResourceSinkComponent.cs.

void Sandbox.Game.EntityComponents.MyResourceSinkComponent.Init ( MyStringHash  group,
float  maxRequiredInput,
Func< float >  requiredInputFunc 
)
inline

Definition at line 107 of file MyResourceSinkComponent.cs.

void Sandbox.Game.EntityComponents.MyResourceSinkComponent.Init ( MyStringHash  group,
MyResourceSinkInfo  sinkData 
)
inline

Definition at line 115 of file MyResourceSinkComponent.cs.

void Sandbox.Game.EntityComponents.MyResourceSinkComponent.Init ( MyStringHash  group,
List< MyResourceSinkInfo sinkData 
)
inline

Definition at line 123 of file MyResourceSinkComponent.cs.

override bool Sandbox.Game.EntityComponents.MyResourceSinkComponent.IsPowerAvailable ( MyDefinitionId  resourceTypeId,
float  power 
)
inlinevirtual
override bool Sandbox.Game.EntityComponents.MyResourceSinkComponent.IsPoweredByType ( MyDefinitionId  resourceTypeId)
inlinevirtual
override float Sandbox.Game.EntityComponents.MyResourceSinkComponent.MaxRequiredInputByType ( MyDefinitionId  resourceTypeId)
inlinevirtual
void Sandbox.Game.EntityComponents.MyResourceSinkComponent.RemoveType ( ref MyDefinitionId  resourceType)
inline

Definition at line 168 of file MyResourceSinkComponent.cs.

override float Sandbox.Game.EntityComponents.MyResourceSinkComponent.RequiredInputByType ( MyDefinitionId  resourceTypeId)
inlinevirtual
override void Sandbox.Game.EntityComponents.MyResourceSinkComponent.SetInputFromDistributor ( MyDefinitionId  resourceTypeId,
float  newResourceInput,
bool  isAdaptible,
bool  fireEvents = true 
)
inlinevirtual

This should be called only from MyResourceDistributor.

Implements VRage.Game.Components.MyResourceSinkComponentBase.

Definition at line 199 of file MyResourceSinkComponent.cs.

override void Sandbox.Game.EntityComponents.MyResourceSinkComponent.SetMaxRequiredInputByType ( MyDefinitionId  resourceTypeId,
float  newMaxRequiredInput 
)
inlinevirtual
override void Sandbox.Game.EntityComponents.MyResourceSinkComponent.SetRequiredInputByType ( MyDefinitionId  resourceTypeId,
float  newRequiredInput 
)
inlinevirtual
override void Sandbox.Game.EntityComponents.MyResourceSinkComponent.SetRequiredInputFuncByType ( MyDefinitionId  resourceTypeId,
Func< float >  newRequiredInputFunc 
)
inlinevirtual

Change the required input function (callback) for given type of resource. It does not call it immediatelly to update required input value.

Implements VRage.Game.Components.MyResourceSinkComponentBase.

Definition at line 297 of file MyResourceSinkComponent.cs.

override float Sandbox.Game.EntityComponents.MyResourceSinkComponent.SuppliedRatioByType ( MyDefinitionId  resourceTypeId)
inlinevirtual
void Sandbox.Game.EntityComponents.MyResourceSinkComponent.Update ( )
inline

Definition at line 247 of file MyResourceSinkComponent.cs.

Member Data Documentation

MyCurrentResourceInputChangedDelegate Sandbox.Game.EntityComponents.MyResourceSinkComponent.CurrentInputChanged

Definition at line 93 of file MyResourceSinkComponent.cs.

Property Documentation

override ListReader<MyDefinitionId> Sandbox.Game.EntityComponents.MyResourceSinkComponent.AcceptedResources
get

Definition at line 88 of file MyResourceSinkComponent.cs.

override string Sandbox.Game.EntityComponents.MyResourceSinkComponent.ComponentTypeDebugString
get

Definition at line 346 of file MyResourceSinkComponent.cs.

float Sandbox.Game.EntityComponents.MyResourceSinkComponent.CurrentInput
get

Definition at line 51 of file MyResourceSinkComponent.cs.

new MyEntity Sandbox.Game.EntityComponents.MyResourceSinkComponent.Entity
get

Definition at line 34 of file MyResourceSinkComponent.cs.

bool Sandbox.Game.EntityComponents.MyResourceSinkComponent.IsPowered
get

Definition at line 53 of file MyResourceSinkComponent.cs.

float Sandbox.Game.EntityComponents.MyResourceSinkComponent.MaxRequiredInput
getset

Definition at line 42 of file MyResourceSinkComponent.cs.

float Sandbox.Game.EntityComponents.MyResourceSinkComponent.RequiredInput
get

Definition at line 47 of file MyResourceSinkComponent.cs.

float Sandbox.Game.EntityComponents.MyResourceSinkComponent.SuppliedRatio
get

Definition at line 49 of file MyResourceSinkComponent.cs.

override IMyEntity Sandbox.Game.EntityComponents.MyResourceSinkComponent.TemporaryConnectedEntity
getset

Definition at line 29 of file MyResourceSinkComponent.cs.

Event Documentation

Action Sandbox.Game.EntityComponents.MyResourceSinkComponent.IsPoweredChanged

Definition at line 94 of file MyResourceSinkComponent.cs.

Action<MyResourceSinkComponent, MyDefinitionId> Sandbox.Game.EntityComponents.MyResourceSinkComponent.OnAddType

Definition at line 97 of file MyResourceSinkComponent.cs.

Action<MyResourceSinkComponent, MyDefinitionId> Sandbox.Game.EntityComponents.MyResourceSinkComponent.OnRemoveType

Definition at line 100 of file MyResourceSinkComponent.cs.

MyRequiredResourceChangeDelegate Sandbox.Game.EntityComponents.MyResourceSinkComponent.RequiredInputChanged

Definition at line 91 of file MyResourceSinkComponent.cs.

MyResourceAvailableDelegate Sandbox.Game.EntityComponents.MyResourceSinkComponent.ResourceAvailable

Definition at line 92 of file MyResourceSinkComponent.cs.


The documentation for this class was generated from the following file: