DIFF

class ConstructionPart

Instanced construction part data classes for dynamic data, statics now stored on EntityType level in ConstructionPartTypeData

Constructors 1

void ConstructionPart(string name, string part_name, string main_part_name, int id, bool is_built, bool is_base, bool is_gate, array<string> required_parts)

Constants 2

static const int BITWISE_SYNCINFO_SIZE_BASE = 2

no. of bits to store synced info, per part. System not ready for variable size parts yet.

Referenced by GetSyncDataSize()
protected const int ANIMATION_EFFECT_DELAY_BUILD = 350

ms

Members 11

protected ConstructionPartTypeData m_PartTypeData

Entity-type object storing non-instanced data

protected int m_LocalSyncBitMask = 0
protected ref TConstructionPartInsiderBoxData m_InsiderBoxData

Grouped modelspace positions of min/max insidebox points

string m_Name
string m_PartName
string m_MainPartName
int m_Id
bool m_IsBase
bool m_IsGate
ref array<string> m_RequiredParts

obsolete, stored on 'ConstructionPartTypeData'

Methods 80

void InitAdditionalPartInstanceInfo(PartInstanceInitData initData)

intended to fill in additional INSTANCE info AFTER basic info is filled (which is tied to constructor parameters from ye olden times). Override as needed.

void PartInstanceDeferredInit(EntityAI parent)

Init stuff reliant on entity position or other stuff that can't be done in constructor

protected void InitInsiderBoxData(EntityAI parent)

'inside' box data to help determine whether the character is inside. Modelspace.

void ComposeSyncDataOnBuild(inout int syncData, int offset)
void ComposeSyncDataOnDismantle(inout int syncData, int offset)
void ComposeSyncDataOnDestroy(inout int syncData, int offset)
protected void ClearPartBitMask(inout int syncData, int offset)
protected int CalculateBitMaskOnBuild(int offset)

default behavior for simple parts

protected int CalculateBitMaskOnDismantle(int offset)

default behavior for simple parts

protected int CalculateBitMaskOnDestroy(int offset)

default behavior for simple parts

int CalculateLocalSyncBitMask(int syncData, int offset)

Translates the bitmask value from the main syncVariable into simple int format of 'GetSyncDataSize' size (currently 2 bits)

void StoreLocalSyncBitMask(int bitmask)
bool IsLocalSyncBuilt()

'true' if synced as built already

translated MODELSPACE positions of min/max memory points (should be single points in memory LOD)

References m_InsiderBoxData
bool CanBeRepaired(int zoneHealthLevel, ItemBase tool = null, PlayerBase player = null)
protected int GetMaxRepairLevel(ItemBase tool = null, PlayerBase player = null)

health state from 'GetHealthLevel', not the actual health float value!

Referenced by CanBeRepaired()
bool DamageHandsOnDeconstruct()
array<string> GetCollisionData()

strings of min/max selections (should be single points in memory LOD)

array<string> GetItemFallingData()

strings of min/max selections (should be single points in memory LOD)

int GetMaterialType()

rough material type, used for effect playback

bool IsReversible()
bool IsReversedLocal()
bool InvertSupportBehavior()

Inverts reaction to support fullfilment

protected void PlayConstructionSound(EntityAI parent, vector effectPos)

Plays sound of current construction state on parent; BaseBuildingBase uses its own class events for this..

protected void PlayConstructionParticle(EntityAI parent, vector effectPos)

Plays particle of current construction state on parent; BaseBuildingBase uses its own class events for this..

void HandleShowConstructionPart(EntityAI parent)
void HandleHideConstructionPart(EntityAI parent)
void HandleAddPhysics(EntityAI parent)
void HandleRemovePhysics(EntityAI parent)
void OnBeforeDismantleServer(EntityAI parent, Man dismantler)
void OnBeforeDestroyServer(EntityAI parent, Man destroyer)
void OnDismantledServer(EntityAI parent, Man dismantler)
void OnDestroyedServer(EntityAI parent, Man destroyer)
protected void TryShowAnim(string animSourceName, notnull EntityAI parent)

Override-friendly

sealed protected void PerformShowAnim(string animSourceName, notnull EntityAI parent)

Sealed on purpose

sealed protected void PerformHideAnim(string animSourceName, notnull EntityAI parent)

Sealed on purpose

void SetRequestBuiltState(bool req_built)