DayZ 1.24
Loading...
Searching...
No Matches
UndergroundTriggerCarrierBase Class Reference
Collaboration diagram for UndergroundTriggerCarrierBase:
[legend]

Private Member Functions

void UndergroundTriggerCarrier ()
 
void ~UndergroundTriggerCarrier ()
 
override void OnVariablesSynchronized ()
 
bool CanSpawnTrigger ()
 
void RequestDelayedTriggerSpawn ()
 
void SpawnTrigger ()
 

Private Attributes

ref JsonUndergroundAreaTriggerData m_Data
 
UndergroundTrigger m_Trigger
 

Detailed Description

This entity exists both client andserver side when it enters into player's bubble and gets instantiated client-side, it will locally spawn UndergroundTrigger, which is the actual trigger

Definition at line 3 of file UndergroundTrigger.c.

Constructor & Destructor Documentation

◆ ~UndergroundTriggerCarrier()

void UndergroundTriggerCarrierBase::~UndergroundTriggerCarrier ( )
inlineprivate

Definition at line 13 of file UndergroundTrigger.c.

14 {
15 if (m_Trigger && !m_Trigger.IsSetForDeletion() && GetGame())
16 {
17 //RemoveChild(m_Trigger);
18 m_Trigger.Delete();
19 }
20 }
proto native CGame GetGame()

References GetGame().

Member Function Documentation

◆ CanSpawnTrigger()

bool UndergroundTriggerCarrierBase::CanSpawnTrigger ( )
inlineprivate

Definition at line 29 of file UndergroundTrigger.c.

30 {
31 return UndergroundAreaLoader.m_JsonData && m_TriggerIndex != -1;
32 }
static ref JsonUndergroundTriggers m_JsonData

References UndergroundAreaLoader::m_JsonData.

Referenced by SpawnTrigger().

◆ OnVariablesSynchronized()

override void UndergroundTriggerCarrierBase::OnVariablesSynchronized ( )
inlineprivate

Definition at line 22 of file UndergroundTrigger.c.

23 {
24 super.OnVariablesSynchronized();
25 if (!m_Trigger)
27 }

References SpawnTrigger().

◆ RequestDelayedTriggerSpawn()

void UndergroundTriggerCarrierBase::RequestDelayedTriggerSpawn ( )
inlineprivate

Definition at line 34 of file UndergroundTrigger.c.

35 {
36 //Print("RequestDelayedTriggerSpawn() " + this);
37 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(SpawnTrigger, 100);
38 }
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8

References CALL_CATEGORY_SYSTEM, and GetGame().

Referenced by SpawnTrigger().

◆ SpawnTrigger()

void UndergroundTriggerCarrierBase::SpawnTrigger ( )
inlineprivate

Definition at line 40 of file UndergroundTrigger.c.

41 {
42
43 if (!CanSpawnTrigger())
44 {
46 return;
47 }
48
49 if (UndergroundAreaLoader.m_JsonData.Triggers && UndergroundAreaLoader.m_JsonData.Triggers.IsValidIndex(m_TriggerIndex))
50 {
52 UndergroundTrigger trigger = UndergroundTrigger.Cast(GetGame().CreateObjectEx("UndergroundTrigger", GetPosition(), ECE_LOCAL));
53 if (trigger)
54 {
55#ifdef DIAG_DEVELOPER
56 trigger.m_Local = true;
57#endif
58 trigger.SetPosition(vector.Zero);
59 AddChild(trigger, -1);
60 trigger.Init(data);
61
63 }
64 }
65 }
const int ECE_LOCAL
class JsonUndergroundAreaTriggerData GetPosition
static const vector Zero
Definition EnConvert.c:110
proto native void AddChild(Widget child, bool immedUpdate=true)

References AddChild(), CanSpawnTrigger(), ECE_LOCAL, GetGame(), GetPosition, UndergroundAreaLoader::m_JsonData, RequestDelayedTriggerSpawn(), and vector::Zero.

Referenced by OnVariablesSynchronized().

◆ UndergroundTriggerCarrier()

void UndergroundTriggerCarrierBase::UndergroundTriggerCarrier ( )
inlineprivate

Definition at line 8 of file UndergroundTrigger.c.

9 {
10 RegisterNetSyncVariableInt("m_TriggerIndex", -1, 255);
11 }

Member Data Documentation

◆ m_Data

ref JsonUndergroundAreaTriggerData UndergroundTriggerCarrierBase::m_Data
private

Definition at line 5 of file UndergroundTrigger.c.

◆ m_Trigger

UndergroundTrigger UndergroundTriggerCarrierBase::m_Trigger
private

Definition at line 6 of file UndergroundTrigger.c.


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