Space Engineers
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
Sandbox.Game.GameSystems.MyEntityThrustComponent Class Referenceabstract
Inheritance diagram for Sandbox.Game.GameSystems.MyEntityThrustComponent:
VRage.Game.Components.MyEntityComponentBase VRage.Game.Components.MyComponentBase

Classes

class  FuelTypeData
 
class  MyConveyorConnectedGroup
 

Public Member Functions

virtual void Init ()
 
virtual void Register (MyEntity entity, Vector3I forwardVector, Func< bool > onRegisteredCallback=null)
 
bool IsRegistered (MyEntity entity, Vector3I forwardVector)
 
virtual void Unregister (MyEntity entity, Vector3I forwardVector)
 
void MergeAllGroupsDirty ()
 
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...
 
virtual void UpdateBeforeSimulation (bool updateDampeners)
 
float GetMaxThrustInDirection (Base6Directions.Direction direction)
 
Vector3 GetAutoPilotThrustForDirection (Vector3 direction)
 
MyResourceSinkComponent ResourceSink (MyEntity thrustEntity)
 Finds the resource sink that should handle the power consumption of thrustEntity More...
 
void ResourceSinks (HashSet< MyResourceSinkComponent > outResourceSinks)
 
void MarkDirty ()
 
bool IsThrustPoweredByType (MyEntity thrustEntity, ref MyDefinitionId fuelId)
 
float GetLastThrustMultiplier (MyEntity thrustEntity)
 
bool HasThrustersInAllDirections (MyDefinitionId fuelId)
 
- 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...
 

Protected Member Functions

 MyEntityThrustComponent ()
 
virtual bool RegisterLazy (MyEntity entity, Vector3I forwardVector, Func< bool > onRegisteredCallback)
 
virtual void UpdateThrusts (bool applyDampeners)
 
virtual Vector3 ApplyThrustModifiers (ref MyDefinitionId fuelType, ref Vector3 thrust, ref Vector3 thrustOverride, MyResourceSinkComponentBase resourceSink)
 
float GetMaxPowerRequirement (FuelTypeData typeData, ref Vector3I direction)
 
float PowerAmountToFuel (ref MyDefinitionId fuelType, float powerAmount, MyConveyorConnectedGroup group)
 
int GetTypeIndex (ref MyDefinitionId fuelId)
 
abstract void UpdateThrustStrength (HashSet< MyEntity > entities, float thrustForce)
 
abstract bool RecomputeOverriddenParameters (MyEntity thrustEntity, FuelTypeData fuelData)
 
abstract bool IsUsed (MyEntity thrustEntity)
 
abstract float ForceMagnitude (MyEntity thrustEntity, float planetaryInfluence, bool inAtmosphere)
 
abstract float CalculateForceMultiplier (MyEntity thrustEntity, float planetaryInfluence, bool inAtmosphere)
 
abstract float CalculateConsumptionMultiplier (MyEntity thrustEntity, float naturalGravityStrength)
 
abstract float MaxPowerConsumption (MyEntity thrustEntity)
 
abstract float MinPowerConsumption (MyEntity thrustEntity)
 
abstract MyDefinitionId FuelType (MyEntity thrustEntity)
 
abstract bool IsThrustEntityType (MyEntity thrustEntity)
 
abstract void RemoveFromGroup (MyEntity thrustEntity, MyConveyorConnectedGroup group)
 
abstract void AddToGroup (MyEntity thrustEntity, MyConveyorConnectedGroup group)
 
virtual float CalculateMass ()
 

Protected Attributes

float m_lastPlanetaryInfluence = -1f
 
bool m_lastPlanetaryInfluenceHasAtmosphere = false
 
float m_lastPlanetaryGravityMagnitude = 0f
 
readonly List< FuelTypeDatam_dataByFuelType = new List<FuelTypeData>()
 
readonly List< MyDefinitionIdm_fuelTypes = new List<MyDefinitionId>()
 
MyResourceSinkComponent m_lastSink
 
FuelTypeData m_lastFuelTypeData
 
MyConveyorConnectedGroup m_lastGroup
 
Vector3 m_totalThrustOverride
 
float m_totalThrustOverridePower
 
readonly MyConcurrentQueue< MyTuple< MyEntity, Vector3I, Func< bool > > > m_thrustEntitiesPending = new MyConcurrentQueue<MyTuple<MyEntity, Vector3I, Func<bool>>>()
 
readonly HashSet< MyEntitym_thrustEntitiesRemovedBeforeRegister = new HashSet<MyEntity>()
 
bool m_thrustsChanged
 True whenever thrust was added or removed. More...
 

Properties

ListReader< MyConveyorConnectedGroupConnectedGroups [get]
 
bool ControlThrustChanged [get, set]
 
Vector3 MaxThrustOverride [get, set]
 
new MyEntity Entity [get]
 
float MaxRequiredPowerInput [get]
 
float MinRequiredPowerInput [get]
 
float SlowdownFactor [get, set]
 For now just the maximum slowdown factor of any thruster registered to the component More...
 
int ThrustCount [get]
 
bool DampenersEnabled [get, set]
 
Vector3 ControlThrust [get, set]
 Torque and thrust wanted by player (from input). More...
 
Vector3 FinalThrust [get]
 Final thrust (clamped by available power, added anti-gravity, slowdown). More...
 
Vector3 AutoPilotControlThrust [get, set]
 Thrust wanted by AutoPilot More...
 
bool AutopilotEnabled [get, set]
 
bool Enabled [get, set]
 
override string ComponentTypeDebugString [get]
 
bool HasPower [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

- Events inherited from VRage.Game.Components.MyEntityComponentBase
static Action< MyEntityComponentBaseOnAfterAddedToContainer
 
Action< MyEntityComponentBaseBeforeRemovedFromContainer
 

Detailed Description

Definition at line 22 of file MyEntityThrustComponent.cs.

Constructor & Destructor Documentation

Sandbox.Game.GameSystems.MyEntityThrustComponent.MyEntityThrustComponent ( )
inlineprotected

Definition at line 298 of file MyEntityThrustComponent.cs.

Member Function Documentation

abstract void Sandbox.Game.GameSystems.MyEntityThrustComponent.AddToGroup ( MyEntity  thrustEntity,
MyConveyorConnectedGroup  group 
)
protectedpure virtual
virtual Vector3 Sandbox.Game.GameSystems.MyEntityThrustComponent.ApplyThrustModifiers ( ref MyDefinitionId  fuelType,
ref Vector3  thrust,
ref Vector3  thrustOverride,
MyResourceSinkComponentBase  resourceSink 
)
inlineprotectedvirtual

Definition at line 1438 of file MyEntityThrustComponent.cs.

abstract float Sandbox.Game.GameSystems.MyEntityThrustComponent.CalculateConsumptionMultiplier ( MyEntity  thrustEntity,
float  naturalGravityStrength 
)
protectedpure virtual
abstract float Sandbox.Game.GameSystems.MyEntityThrustComponent.CalculateForceMultiplier ( MyEntity  thrustEntity,
float  planetaryInfluence,
bool  inAtmosphere 
)
protectedpure virtual
virtual float Sandbox.Game.GameSystems.MyEntityThrustComponent.CalculateMass ( )
inlineprotectedvirtual

Definition at line 1803 of file MyEntityThrustComponent.cs.

abstract float Sandbox.Game.GameSystems.MyEntityThrustComponent.ForceMagnitude ( MyEntity  thrustEntity,
float  planetaryInfluence,
bool  inAtmosphere 
)
protectedpure virtual
abstract MyDefinitionId Sandbox.Game.GameSystems.MyEntityThrustComponent.FuelType ( MyEntity  thrustEntity)
protectedpure virtual
Vector3 Sandbox.Game.GameSystems.MyEntityThrustComponent.GetAutoPilotThrustForDirection ( Vector3  direction)
inline

Definition at line 1210 of file MyEntityThrustComponent.cs.

float Sandbox.Game.GameSystems.MyEntityThrustComponent.GetLastThrustMultiplier ( MyEntity  thrustEntity)
inline

Definition at line 1798 of file MyEntityThrustComponent.cs.

float Sandbox.Game.GameSystems.MyEntityThrustComponent.GetMaxPowerRequirement ( FuelTypeData  typeData,
ref Vector3I  direction 
)
inlineprotected

Definition at line 1667 of file MyEntityThrustComponent.cs.

float Sandbox.Game.GameSystems.MyEntityThrustComponent.GetMaxThrustInDirection ( Base6Directions.Direction  direction)
inline

Definition at line 1059 of file MyEntityThrustComponent.cs.

int Sandbox.Game.GameSystems.MyEntityThrustComponent.GetTypeIndex ( ref MyDefinitionId  fuelId)
inlineprotected

Definition at line 1724 of file MyEntityThrustComponent.cs.

bool Sandbox.Game.GameSystems.MyEntityThrustComponent.HasThrustersInAllDirections ( MyDefinitionId  fuelId)
inline

Definition at line 1816 of file MyEntityThrustComponent.cs.

virtual void Sandbox.Game.GameSystems.MyEntityThrustComponent.Init ( )
inlinevirtual

Definition at line 303 of file MyEntityThrustComponent.cs.

bool Sandbox.Game.GameSystems.MyEntityThrustComponent.IsRegistered ( MyEntity  entity,
Vector3I  forwardVector 
)
inline

Definition at line 395 of file MyEntityThrustComponent.cs.

abstract bool Sandbox.Game.GameSystems.MyEntityThrustComponent.IsThrustEntityType ( MyEntity  thrustEntity)
protectedpure virtual
bool Sandbox.Game.GameSystems.MyEntityThrustComponent.IsThrustPoweredByType ( MyEntity  thrustEntity,
ref MyDefinitionId  fuelId 
)
inline

Definition at line 1718 of file MyEntityThrustComponent.cs.

abstract bool Sandbox.Game.GameSystems.MyEntityThrustComponent.IsUsed ( MyEntity  thrustEntity)
protectedpure virtual
void Sandbox.Game.GameSystems.MyEntityThrustComponent.MarkDirty ( )
inline

Definition at line 1672 of file MyEntityThrustComponent.cs.

abstract float Sandbox.Game.GameSystems.MyEntityThrustComponent.MaxPowerConsumption ( MyEntity  thrustEntity)
protectedpure virtual
void Sandbox.Game.GameSystems.MyEntityThrustComponent.MergeAllGroupsDirty ( )
inline

Definition at line 664 of file MyEntityThrustComponent.cs.

abstract float Sandbox.Game.GameSystems.MyEntityThrustComponent.MinPowerConsumption ( MyEntity  thrustEntity)
protectedpure virtual
override void Sandbox.Game.GameSystems.MyEntityThrustComponent.OnAddedToContainer ( )
inlinevirtual

Gets called after the container of this component changes

Reimplemented from VRage.Game.Components.MyComponentBase.

Definition at line 901 of file MyEntityThrustComponent.cs.

override void Sandbox.Game.GameSystems.MyEntityThrustComponent.OnBeforeRemovedFromContainer ( )
inlinevirtual

Gets called before the removal of this component from a container

Reimplemented from VRage.Game.Components.MyComponentBase.

Definition at line 915 of file MyEntityThrustComponent.cs.

float Sandbox.Game.GameSystems.MyEntityThrustComponent.PowerAmountToFuel ( ref MyDefinitionId  fuelType,
float  powerAmount,
MyConveyorConnectedGroup  group 
)
inlineprotected

Definition at line 1695 of file MyEntityThrustComponent.cs.

abstract bool Sandbox.Game.GameSystems.MyEntityThrustComponent.RecomputeOverriddenParameters ( MyEntity  thrustEntity,
FuelTypeData  fuelData 
)
protectedpure virtual
virtual void Sandbox.Game.GameSystems.MyEntityThrustComponent.Register ( MyEntity  entity,
Vector3I  forwardVector,
Func< bool >  onRegisteredCallback = null 
)
inlinevirtual

Definition at line 312 of file MyEntityThrustComponent.cs.

virtual bool Sandbox.Game.GameSystems.MyEntityThrustComponent.RegisterLazy ( MyEntity  entity,
Vector3I  forwardVector,
Func< bool >  onRegisteredCallback 
)
inlineprotectedvirtual

Definition at line 390 of file MyEntityThrustComponent.cs.

abstract void Sandbox.Game.GameSystems.MyEntityThrustComponent.RemoveFromGroup ( MyEntity  thrustEntity,
MyConveyorConnectedGroup  group 
)
protectedpure virtual
MyResourceSinkComponent Sandbox.Game.GameSystems.MyEntityThrustComponent.ResourceSink ( MyEntity  thrustEntity)
inline

Finds the resource sink that should handle the power consumption of thrustEntity

Definition at line 1597 of file MyEntityThrustComponent.cs.

void Sandbox.Game.GameSystems.MyEntityThrustComponent.ResourceSinks ( HashSet< MyResourceSinkComponent outResourceSinks)
inline

Definition at line 1604 of file MyEntityThrustComponent.cs.

virtual void Sandbox.Game.GameSystems.MyEntityThrustComponent.Unregister ( MyEntity  entity,
Vector3I  forwardVector 
)
inlinevirtual

Definition at line 426 of file MyEntityThrustComponent.cs.

virtual void Sandbox.Game.GameSystems.MyEntityThrustComponent.UpdateBeforeSimulation ( bool  updateDampeners)
inlinevirtual

Definition at line 936 of file MyEntityThrustComponent.cs.

virtual void Sandbox.Game.GameSystems.MyEntityThrustComponent.UpdateThrusts ( bool  applyDampeners)
inlineprotectedvirtual

Definition at line 1129 of file MyEntityThrustComponent.cs.

abstract void Sandbox.Game.GameSystems.MyEntityThrustComponent.UpdateThrustStrength ( HashSet< MyEntity entities,
float  thrustForce 
)
protectedpure virtual

Member Data Documentation

readonly List<FuelTypeData> Sandbox.Game.GameSystems.MyEntityThrustComponent.m_dataByFuelType = new List<FuelTypeData>()
protected

Definition at line 138 of file MyEntityThrustComponent.cs.

readonly List<MyDefinitionId> Sandbox.Game.GameSystems.MyEntityThrustComponent.m_fuelTypes = new List<MyDefinitionId>()
protected

Definition at line 144 of file MyEntityThrustComponent.cs.

FuelTypeData Sandbox.Game.GameSystems.MyEntityThrustComponent.m_lastFuelTypeData
protected

Definition at line 151 of file MyEntityThrustComponent.cs.

MyConveyorConnectedGroup Sandbox.Game.GameSystems.MyEntityThrustComponent.m_lastGroup
protected

Definition at line 152 of file MyEntityThrustComponent.cs.

float Sandbox.Game.GameSystems.MyEntityThrustComponent.m_lastPlanetaryGravityMagnitude = 0f
protected

Definition at line 131 of file MyEntityThrustComponent.cs.

float Sandbox.Game.GameSystems.MyEntityThrustComponent.m_lastPlanetaryInfluence = -1f
protected

Definition at line 129 of file MyEntityThrustComponent.cs.

bool Sandbox.Game.GameSystems.MyEntityThrustComponent.m_lastPlanetaryInfluenceHasAtmosphere = false
protected

Definition at line 130 of file MyEntityThrustComponent.cs.

MyResourceSinkComponent Sandbox.Game.GameSystems.MyEntityThrustComponent.m_lastSink
protected

Definition at line 150 of file MyEntityThrustComponent.cs.

readonly MyConcurrentQueue<MyTuple<MyEntity, Vector3I, Func<bool> > > Sandbox.Game.GameSystems.MyEntityThrustComponent.m_thrustEntitiesPending = new MyConcurrentQueue<MyTuple<MyEntity, Vector3I, Func<bool>>>()
protected

Definition at line 173 of file MyEntityThrustComponent.cs.

readonly HashSet<MyEntity> Sandbox.Game.GameSystems.MyEntityThrustComponent.m_thrustEntitiesRemovedBeforeRegister = new HashSet<MyEntity>()
protected

Definition at line 174 of file MyEntityThrustComponent.cs.

bool Sandbox.Game.GameSystems.MyEntityThrustComponent.m_thrustsChanged
protected

True whenever thrust was added or removed.

Definition at line 181 of file MyEntityThrustComponent.cs.

Vector3 Sandbox.Game.GameSystems.MyEntityThrustComponent.m_totalThrustOverride
protected

Definition at line 154 of file MyEntityThrustComponent.cs.

float Sandbox.Game.GameSystems.MyEntityThrustComponent.m_totalThrustOverridePower
protected

Definition at line 155 of file MyEntityThrustComponent.cs.

Property Documentation

Vector3 Sandbox.Game.GameSystems.MyEntityThrustComponent.AutoPilotControlThrust
getset

Thrust wanted by AutoPilot

Definition at line 239 of file MyEntityThrustComponent.cs.

bool Sandbox.Game.GameSystems.MyEntityThrustComponent.AutopilotEnabled
getset

Definition at line 241 of file MyEntityThrustComponent.cs.

override string Sandbox.Game.GameSystems.MyEntityThrustComponent.ComponentTypeDebugString
get

Definition at line 1796 of file MyEntityThrustComponent.cs.

ListReader<MyConveyorConnectedGroup> Sandbox.Game.GameSystems.MyEntityThrustComponent.ConnectedGroups
getprotected

Definition at line 148 of file MyEntityThrustComponent.cs.

Vector3 Sandbox.Game.GameSystems.MyEntityThrustComponent.ControlThrust
getset

Torque and thrust wanted by player (from input).

Definition at line 222 of file MyEntityThrustComponent.cs.

bool Sandbox.Game.GameSystems.MyEntityThrustComponent.ControlThrustChanged
getsetprotected

Definition at line 185 of file MyEntityThrustComponent.cs.

bool Sandbox.Game.GameSystems.MyEntityThrustComponent.DampenersEnabled
getset

Definition at line 215 of file MyEntityThrustComponent.cs.

bool Sandbox.Game.GameSystems.MyEntityThrustComponent.Enabled
getset

Definition at line 243 of file MyEntityThrustComponent.cs.

new MyEntity Sandbox.Game.GameSystems.MyEntityThrustComponent.Entity
get

Definition at line 204 of file MyEntityThrustComponent.cs.

Vector3 Sandbox.Game.GameSystems.MyEntityThrustComponent.FinalThrust
get

Final thrust (clamped by available power, added anti-gravity, slowdown).

Definition at line 234 of file MyEntityThrustComponent.cs.

bool Sandbox.Game.GameSystems.MyEntityThrustComponent.HasPower
get

Definition at line 1809 of file MyEntityThrustComponent.cs.

float Sandbox.Game.GameSystems.MyEntityThrustComponent.MaxRequiredPowerInput
get

Definition at line 206 of file MyEntityThrustComponent.cs.

Vector3 Sandbox.Game.GameSystems.MyEntityThrustComponent.MaxThrustOverride
getset

Definition at line 192 of file MyEntityThrustComponent.cs.

float Sandbox.Game.GameSystems.MyEntityThrustComponent.MinRequiredPowerInput
get

Definition at line 207 of file MyEntityThrustComponent.cs.

float Sandbox.Game.GameSystems.MyEntityThrustComponent.SlowdownFactor
getset

For now just the maximum slowdown factor of any thruster registered to the component

Definition at line 212 of file MyEntityThrustComponent.cs.

int Sandbox.Game.GameSystems.MyEntityThrustComponent.ThrustCount
get

Definition at line 214 of file MyEntityThrustComponent.cs.


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