Space Engineers
Public Member Functions | Static Public Attributes | Properties | List of all members
Sandbox.Game.Components.MyCharacterStatComponent Class Reference
Inheritance diagram for Sandbox.Game.Components.MyCharacterStatComponent:
Sandbox.Game.Components.MyEntityStatComponent VRage.Game.Components.MyEntityComponentBase VRage.Game.Components.MyComponentBase

Public Member Functions

override void Update ()
 
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...
 
void OnHealthChanged (float newHealth, float oldHealth, object statChangeData)
 
void DoDamage (float damage, bool updateSync, object statChangeData=null)
 
void Consume (MyFixedPoint amount, MyConsumableItemDefinition definition)
 
- Public Member Functions inherited from Sandbox.Game.Components.MyEntityStatComponent
void RequestStatChange (MyEntityStat stat)
 
 MyEntityStatComponent ()
 
override MyObjectBuilder_ComponentBase Serialize (bool copy=false)
 
override void Deserialize (MyObjectBuilder_ComponentBase objectBuilder)
 
override bool IsSerialized ()
 Tells the component container serializer whether this component should be saved More...
 
override void Init (MyComponentDefinitionBase definition)
 
bool TryGetStat (MyStringHash statId, out MyEntityStat outStat)
 
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...
 
bool CanDoAction (string actionId, out MyTuple< ushort, MyStringHash > message, bool continuous=false)
 
bool DoAction (string actionId)
 
void ApplyModifier (string modifierId)
 
float GetEfficiencyModifier (string modifierId)
 
- 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...
 

Static Public Attributes

static MyStringHash HealthId = MyStringHash.GetOrCompute("Health")
 
static readonly float LOW_HEALTH_RATIO = 0.2f
 

Properties

MyEntityStat Health [get]
 
MyDamageInformation LastDamage [get]
 
float HealthRatio [get]
 
- Properties inherited from Sandbox.Game.Components.MyEntityStatComponent
DictionaryValuesReader< MyStringHash, MyEntityStatStats [get]
 
override string ComponentTypeDebugString [get]
 
- 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...
 

Additional Inherited Members

- Protected Attributes inherited from Sandbox.Game.Components.MyEntityStatComponent
List< MyStatLogicm_scripts
 
- Events inherited from VRage.Game.Components.MyEntityComponentBase
static Action< MyEntityComponentBaseOnAfterAddedToContainer
 
Action< MyEntityComponentBaseBeforeRemovedFromContainer
 

Detailed Description

Definition at line 15 of file MyCharacterStatComponent.cs.

Member Function Documentation

void Sandbox.Game.Components.MyCharacterStatComponent.Consume ( MyFixedPoint  amount,
MyConsumableItemDefinition  definition 
)
inline

Definition at line 107 of file MyCharacterStatComponent.cs.

void Sandbox.Game.Components.MyCharacterStatComponent.DoDamage ( float  damage,
bool  updateSync,
object  statChangeData = null 
)
inline

Definition at line 88 of file MyCharacterStatComponent.cs.

override void Sandbox.Game.Components.MyCharacterStatComponent.OnAddedToContainer ( )
inlinevirtual

Gets called after the container of this component changes

Reimplemented from VRage.Game.Components.MyComponentBase.

Definition at line 52 of file MyCharacterStatComponent.cs.

override void Sandbox.Game.Components.MyCharacterStatComponent.OnBeforeRemovedFromContainer ( )
inlinevirtual

Gets called before the removal of this component from a container

Reimplemented from VRage.Game.Components.MyComponentBase.

Definition at line 59 of file MyCharacterStatComponent.cs.

void Sandbox.Game.Components.MyCharacterStatComponent.OnHealthChanged ( float  newHealth,
float  oldHealth,
object  statChangeData 
)
inline

Definition at line 66 of file MyCharacterStatComponent.cs.

override void Sandbox.Game.Components.MyCharacterStatComponent.Update ( )
inlinevirtual

Reimplemented from Sandbox.Game.Components.MyEntityStatComponent.

Definition at line 36 of file MyCharacterStatComponent.cs.

Member Data Documentation

MyStringHash Sandbox.Game.Components.MyCharacterStatComponent.HealthId = MyStringHash.GetOrCompute("Health")
static

Definition at line 17 of file MyCharacterStatComponent.cs.

readonly float Sandbox.Game.Components.MyCharacterStatComponent.LOW_HEALTH_RATIO = 0.2f
static

Definition at line 32 of file MyCharacterStatComponent.cs.

Property Documentation

MyEntityStat Sandbox.Game.Components.MyCharacterStatComponent.Health
get

Definition at line 20 of file MyCharacterStatComponent.cs.

float Sandbox.Game.Components.MyCharacterStatComponent.HealthRatio
get

Definition at line 30 of file MyCharacterStatComponent.cs.

MyDamageInformation Sandbox.Game.Components.MyCharacterStatComponent.LastDamage
get

Definition at line 28 of file MyCharacterStatComponent.cs.


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