Space Engineers
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Properties | Events | List of all members
Sandbox.Game.Entities.MyComponentStack Class Reference

Classes

struct  GroupInfo
 

Public Member Functions

 MyComponentStack (MyCubeBlockDefinition BlockDefinition, float integrityPercent, float buildPercent)
 
void UpdateBuildIntegrityUp ()
 
void UpdateBuildIntegrityDown (float ratio)
 
bool CanContinueBuild (MyInventoryBase inventory, MyConstructionStockpile stockpile)
 
void GetMissingInfo (out int groupIndex, out int componentCount)
 
void DestroyCompletely ()
 
void GetMissingComponents (Dictionary< string, int > addToDictionary, MyConstructionStockpile availableItems=null)
 
void IncreaseMountLevel (float mountAmount, MyConstructionStockpile stockpile=null)
 
void DecreaseMountLevel (float unmountAmount, MyConstructionStockpile outputStockpile=null, bool useDefaultDeconstructEfficiency=false)
 Dismounts component stack, dismounted items are put into output stockpile More...
 
void ApplyDamage (float damage, MyConstructionStockpile outputStockpile=null)
 Applies damage to the component stack. The method works almost the same as dismounting, it just leaves the build level at the original value and also the parts that are put into the outputStockpile are damaged. More...
 
GroupInfo GetGroupInfo (int index)
 

Static Public Member Functions

static void GetMountedComponents (MyComponentList addToList, MyObjectBuilder_CubeBlock block)
 

Public Attributes

const float MOUNT_THRESHOLD = 1.0f/(float)ushort.MaxValue
 Mount threshold, required because of float inaccuracy. Component that has integrity beyond this threshold is considered unmounted. The integrity of the whole stack will never fall beyond this level (unless the stack is fully dismounted) More...
 

Properties

bool IsFullIntegrity [get]
 
bool IsFullyDismounted [get]
 
bool IsDestroyed [get]
 
float Integrity [get]
 
float IntegrityRatio [get]
 
float MaxIntegrity [get]
 
float BuildRatio [get]
 
float BuildIntegrity [get]
 
static float NewBlockIntegrity [get]
 
bool IsFunctional [get]
 Component stack is functional when critical part is not destroyed (integrity > 0). IMPORTANT: When you change the logic beyond this property, don't forget to call CheckFunctionalState every time the functional state could have been changed! (Also, remove calls to CheckFunctionalState where no longer needed) More...
 
int GroupCount [get]
 

Events

Action IsFunctionalChanged
 

Detailed Description

Definition at line 22 of file MyComponentStack.cs.

Constructor & Destructor Documentation

Sandbox.Game.Entities.MyComponentStack.MyComponentStack ( MyCubeBlockDefinition  BlockDefinition,
float  integrityPercent,
float  buildPercent 
)
inline

Definition at line 149 of file MyComponentStack.cs.

Member Function Documentation

void Sandbox.Game.Entities.MyComponentStack.ApplyDamage ( float  damage,
MyConstructionStockpile  outputStockpile = null 
)
inline

Applies damage to the component stack. The method works almost the same as dismounting, it just leaves the build level at the original value and also the parts that are put into the outputStockpile are damaged.

Definition at line 510 of file MyComponentStack.cs.

bool Sandbox.Game.Entities.MyComponentStack.CanContinueBuild ( MyInventoryBase  inventory,
MyConstructionStockpile  stockpile 
)
inline

Definition at line 269 of file MyComponentStack.cs.

void Sandbox.Game.Entities.MyComponentStack.DecreaseMountLevel ( float  unmountAmount,
MyConstructionStockpile  outputStockpile = null,
bool  useDefaultDeconstructEfficiency = false 
)
inline

Dismounts component stack, dismounted items are put into output stockpile

Definition at line 494 of file MyComponentStack.cs.

void Sandbox.Game.Entities.MyComponentStack.DestroyCompletely ( )
inline

Definition at line 326 of file MyComponentStack.cs.

GroupInfo Sandbox.Game.Entities.MyComponentStack.GetGroupInfo ( int  index)
inline

Definition at line 620 of file MyComponentStack.cs.

void Sandbox.Game.Entities.MyComponentStack.GetMissingComponents ( Dictionary< string, int >  addToDictionary,
MyConstructionStockpile  availableItems = null 
)
inline

Definition at line 349 of file MyComponentStack.cs.

void Sandbox.Game.Entities.MyComponentStack.GetMissingInfo ( out int  groupIndex,
out int  componentCount 
)
inline

Definition at line 296 of file MyComponentStack.cs.

static void Sandbox.Game.Entities.MyComponentStack.GetMountedComponents ( MyComponentList  addToList,
MyObjectBuilder_CubeBlock  block 
)
inlinestatic

Definition at line 387 of file MyComponentStack.cs.

void Sandbox.Game.Entities.MyComponentStack.IncreaseMountLevel ( float  mountAmount,
MyConstructionStockpile  stockpile = null 
)
inline

Definition at line 424 of file MyComponentStack.cs.

void Sandbox.Game.Entities.MyComponentStack.UpdateBuildIntegrityDown ( float  ratio)
inline

Definition at line 261 of file MyComponentStack.cs.

void Sandbox.Game.Entities.MyComponentStack.UpdateBuildIntegrityUp ( )
inline

Definition at line 253 of file MyComponentStack.cs.

Member Data Documentation

const float Sandbox.Game.Entities.MyComponentStack.MOUNT_THRESHOLD = 1.0f/(float)ushort.MaxValue

Mount threshold, required because of float inaccuracy. Component that has integrity beyond this threshold is considered unmounted. The integrity of the whole stack will never fall beyond this level (unless the stack is fully dismounted)

Definition at line 43 of file MyComponentStack.cs.

Property Documentation

float Sandbox.Game.Entities.MyComponentStack.BuildIntegrity
get

Definition at line 104 of file MyComponentStack.cs.

float Sandbox.Game.Entities.MyComponentStack.BuildRatio
get

Definition at line 99 of file MyComponentStack.cs.

int Sandbox.Game.Entities.MyComponentStack.GroupCount
get

Definition at line 613 of file MyComponentStack.cs.

float Sandbox.Game.Entities.MyComponentStack.Integrity
get

Definition at line 75 of file MyComponentStack.cs.

float Sandbox.Game.Entities.MyComponentStack.IntegrityRatio
get

Definition at line 89 of file MyComponentStack.cs.

bool Sandbox.Game.Entities.MyComponentStack.IsDestroyed
get

Definition at line 70 of file MyComponentStack.cs.

bool Sandbox.Game.Entities.MyComponentStack.IsFullIntegrity
get

Definition at line 60 of file MyComponentStack.cs.

bool Sandbox.Game.Entities.MyComponentStack.IsFullyDismounted
get

Definition at line 65 of file MyComponentStack.cs.

bool Sandbox.Game.Entities.MyComponentStack.IsFunctional
get

Component stack is functional when critical part is not destroyed (integrity > 0). IMPORTANT: When you change the logic beyond this property, don't forget to call CheckFunctionalState every time the functional state could have been changed! (Also, remove calls to CheckFunctionalState where no longer needed)

Definition at line 131 of file MyComponentStack.cs.

float Sandbox.Game.Entities.MyComponentStack.MaxIntegrity
get

Definition at line 94 of file MyComponentStack.cs.

float Sandbox.Game.Entities.MyComponentStack.NewBlockIntegrity
staticget

Definition at line 121 of file MyComponentStack.cs.

Event Documentation

Action Sandbox.Game.Entities.MyComponentStack.IsFunctionalChanged

Definition at line 138 of file MyComponentStack.cs.


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