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

Protected Member Functions

ScriptInvoker GetOnEnterInvoker ()
 
ScriptInvoker GetOnLeaveInvoker ()
 
OnEnter

Called when an object enters the trigger

void Enter (TriggerInsider insider)
 
void OnEnterBeginEvent (TriggerInsider insider)
 
void OnEnterServerEvent (TriggerInsider insider)
 
void OnEnterClientEvent (TriggerInsider insider)
 
void OnEnterEndEvent (TriggerInsider insider)
 
OnStayStart

Called at the beginning of an update loop

void StayStart (int nrOfInsiders)
 
void OnStayStartBeginEvent (int nrOfInsiders)
 
void OnStayStartServerEvent (int nrOfInsiders)
 
void OnStayStartClientEvent (int nrOfInsiders)
 
void OnStayStartEndEvent (int nrOfInsiders)
 
OnStay

Called in the update loop

void Stay (TriggerInsider insider, float deltaTime)
 
void OnStayBeginEvent (TriggerInsider insider, float deltaTime)
 
void OnStayServerEvent (TriggerInsider insider, float deltaTime)
 
void OnStayClientEvent (TriggerInsider insider, float deltaTime)
 
void OnStayEndEvent (TriggerInsider insider, float deltaTime)
 
OnStayFinish

Called at the end of an update loop

void StayFinish ()
 
void OnStayFinishBeginEvent ()
 
void OnStayFinishServerEvent ()
 
void OnStayFinishClientEvent ()
 
void OnStayFinishEndEvent ()
 
OnLeave

Called when an object leaves the trigger

void Leave (TriggerInsider insider)
 
void OnLeaveBeginEvent (TriggerInsider insider)
 
void OnLeaveServerEvent (TriggerInsider insider)
 
void OnLeaveClientEvent (TriggerInsider insider)
 
void OnLeaveEndEvent (TriggerInsider insider)
 

Protected Attributes

ref ScriptInvoker m_OnEnterInvoker
 
ref ScriptInvoker m_OnLeaveInvoker
 

Detailed Description

Events API for triggers, keep in sync with AreaDamageEvents for consistency NOTE: The deltaTime passed in is the one for the Insider specifically.

Definition at line 3 of file TriggerEvents.c.

Member Function Documentation

◆ Enter()

void TriggerEvents::Enter ( TriggerInsider insider)
inlineprotected

Definition at line 26 of file TriggerEvents.c.

27 {
28#ifdef TRIGGER_DEBUG_BASIC
29 Debug.TriggerLog(GetDebugName(insider.GetObject()), "TriggerEvents", "", "Enter", GetDebugName(this));
30#endif
31
32 OnEnterBeginEvent(insider);
33
35 m_OnEnterInvoker.Invoke(insider);
36
37 if (GetGame().IsServer())
38 OnEnterServerEvent(insider);
39 else
40 OnEnterClientEvent(insider);
41
42 OnEnterEndEvent(insider);
43 }
Definition Debug.c:14
static void TriggerLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:223
void OnEnterClientEvent(TriggerInsider insider)
ref ScriptInvoker m_OnEnterInvoker
void OnEnterServerEvent(TriggerInsider insider)
void OnEnterEndEvent(TriggerInsider insider)
void OnEnterBeginEvent(TriggerInsider insider)
Object GetObject()
Definition Trigger.c:28
override string GetDebugName()
proto native CGame GetGame()

References GetDebugName(), GetGame(), TriggerInsider::GetObject(), m_OnEnterInvoker, OnEnterBeginEvent(), OnEnterClientEvent(), OnEnterEndEvent(), OnEnterServerEvent(), and Debug::TriggerLog().

Referenced by Trigger::AddInsider().

◆ GetOnEnterInvoker()

ScriptInvoker TriggerEvents::GetOnEnterInvoker ( )
inlineprotected

Definition at line 8 of file TriggerEvents.c.

9 {
12 return m_OnEnterInvoker;
13 }
ScriptInvoker Class provide list of callbacks usage:
Definition tools.c:116

References m_OnEnterInvoker.

◆ GetOnLeaveInvoker()

ScriptInvoker TriggerEvents::GetOnLeaveInvoker ( )
inlineprotected

Definition at line 15 of file TriggerEvents.c.

16 {
19 return m_OnLeaveInvoker;
20 }
ref ScriptInvoker m_OnLeaveInvoker

References m_OnLeaveInvoker.

◆ Leave()

void TriggerEvents::Leave ( TriggerInsider insider)
inlineprotected

Definition at line 129 of file TriggerEvents.c.

130 {
131#ifdef TRIGGER_DEBUG_BASIC
132 Debug.TriggerLog(GetDebugName(insider.GetObject()), "TriggerEvents", "", "Leave", GetDebugName(this));
133#endif
134
135 OnLeaveBeginEvent(insider);
136
138 m_OnLeaveInvoker.Invoke(insider);
139
140 if (GetGame() && GetGame().IsServer())
141 OnLeaveServerEvent(insider);
142 else
143 OnLeaveClientEvent(insider);
144
145 OnLeaveEndEvent(insider);
146 }
void OnLeaveClientEvent(TriggerInsider insider)
void OnLeaveServerEvent(TriggerInsider insider)
void OnLeaveEndEvent(TriggerInsider insider)
void OnLeaveBeginEvent(TriggerInsider insider)

References GetDebugName(), GetGame(), TriggerInsider::GetObject(), m_OnLeaveInvoker, OnLeaveBeginEvent(), OnLeaveClientEvent(), OnLeaveEndEvent(), OnLeaveServerEvent(), and Debug::TriggerLog().

Referenced by Trigger::RemoveInsider().

◆ OnEnterBeginEvent()

void TriggerEvents::OnEnterBeginEvent ( TriggerInsider insider)
inlineprotected

Definition at line 44 of file TriggerEvents.c.

44{}

Referenced by Enter().

◆ OnEnterClientEvent()

void TriggerEvents::OnEnterClientEvent ( TriggerInsider insider)
inlineprotected

Definition at line 46 of file TriggerEvents.c.

46{}

Referenced by Enter().

◆ OnEnterEndEvent()

void TriggerEvents::OnEnterEndEvent ( TriggerInsider insider)
inlineprotected

Definition at line 47 of file TriggerEvents.c.

47{}

Referenced by Enter().

◆ OnEnterServerEvent()

void TriggerEvents::OnEnterServerEvent ( TriggerInsider insider)
inlineprotected

Definition at line 45 of file TriggerEvents.c.

45{}

Referenced by Enter().

◆ OnLeaveBeginEvent()

void TriggerEvents::OnLeaveBeginEvent ( TriggerInsider insider)
inlineprotected

Definition at line 147 of file TriggerEvents.c.

147{}

Referenced by Leave().

◆ OnLeaveClientEvent()

void TriggerEvents::OnLeaveClientEvent ( TriggerInsider insider)
inlineprotected

Definition at line 149 of file TriggerEvents.c.

149{}

Referenced by Leave().

◆ OnLeaveEndEvent()

void TriggerEvents::OnLeaveEndEvent ( TriggerInsider insider)
inlineprotected

Definition at line 150 of file TriggerEvents.c.

150{}

Referenced by Leave().

◆ OnLeaveServerEvent()

void TriggerEvents::OnLeaveServerEvent ( TriggerInsider insider)
inlineprotected

Definition at line 148 of file TriggerEvents.c.

148{}

Referenced by Leave().

◆ OnStayBeginEvent()

void TriggerEvents::OnStayBeginEvent ( TriggerInsider insider,
float deltaTime )
inlineprotected

Definition at line 94 of file TriggerEvents.c.

94{}

Referenced by Stay().

◆ OnStayClientEvent()

void TriggerEvents::OnStayClientEvent ( TriggerInsider insider,
float deltaTime )
inlineprotected

Definition at line 96 of file TriggerEvents.c.

96{}

Referenced by Stay().

◆ OnStayEndEvent()

void TriggerEvents::OnStayEndEvent ( TriggerInsider insider,
float deltaTime )
inlineprotected

Definition at line 97 of file TriggerEvents.c.

97{}

Referenced by Stay().

◆ OnStayFinishBeginEvent()

void TriggerEvents::OnStayFinishBeginEvent ( )
inlineprotected

Definition at line 119 of file TriggerEvents.c.

119{}

Referenced by StayFinish().

◆ OnStayFinishClientEvent()

void TriggerEvents::OnStayFinishClientEvent ( )
inlineprotected

Definition at line 121 of file TriggerEvents.c.

121{}

Referenced by StayFinish().

◆ OnStayFinishEndEvent()

void TriggerEvents::OnStayFinishEndEvent ( )
inlineprotected

Definition at line 122 of file TriggerEvents.c.

122{}

Referenced by StayFinish().

◆ OnStayFinishServerEvent()

void TriggerEvents::OnStayFinishServerEvent ( )
inlineprotected

Definition at line 120 of file TriggerEvents.c.

120{}

Referenced by StayFinish().

◆ OnStayServerEvent()

void TriggerEvents::OnStayServerEvent ( TriggerInsider insider,
float deltaTime )
inlineprotected

Definition at line 95 of file TriggerEvents.c.

95{}

Referenced by Stay().

◆ OnStayStartBeginEvent()

void TriggerEvents::OnStayStartBeginEvent ( int nrOfInsiders)
inlineprotected

Definition at line 69 of file TriggerEvents.c.

69{}

Referenced by StayStart().

◆ OnStayStartClientEvent()

void TriggerEvents::OnStayStartClientEvent ( int nrOfInsiders)
inlineprotected

Definition at line 71 of file TriggerEvents.c.

71{}

Referenced by StayStart().

◆ OnStayStartEndEvent()

void TriggerEvents::OnStayStartEndEvent ( int nrOfInsiders)
inlineprotected

Definition at line 72 of file TriggerEvents.c.

72{}

Referenced by StayStart().

◆ OnStayStartServerEvent()

void TriggerEvents::OnStayStartServerEvent ( int nrOfInsiders)
inlineprotected

Definition at line 70 of file TriggerEvents.c.

70{}

Referenced by StayStart().

◆ Stay()

void TriggerEvents::Stay ( TriggerInsider insider,
float deltaTime )
inlineprotected

Definition at line 79 of file TriggerEvents.c.

80 {
81#ifdef TRIGGER_DEBUG_SPAM
82 Debug.TriggerLog(GetDebugName(insider.GetObject()), "TriggerEvents", "", "Stay", GetDebugName(this));
83#endif
84
86
87 if (GetGame().IsServer())
89 else
91
92 OnStayEndEvent(insider, deltaTime);
93 }
void OnStayServerEvent(TriggerInsider insider, float deltaTime)
void OnStayClientEvent(TriggerInsider insider, float deltaTime)
void OnStayBeginEvent(TriggerInsider insider, float deltaTime)
void OnStayEndEvent(TriggerInsider insider, float deltaTime)

References GetDebugName(), GetGame(), TriggerInsider::GetObject(), OnStayBeginEvent(), OnStayClientEvent(), OnStayEndEvent(), OnStayServerEvent(), and Debug::TriggerLog().

Referenced by Trigger::UpdateInsiders().

◆ StayFinish()

void TriggerEvents::StayFinish ( )
inlineprotected

Definition at line 104 of file TriggerEvents.c.

105 {
106#ifdef TRIGGER_DEBUG_SPAM
107 Debug.TriggerLog("", "TriggerEvents", "", "StayFinish", GetDebugName(this));
108#endif
109
111
112 if (GetGame().IsServer())
114 else
116
118 }
void OnStayFinishEndEvent()
void OnStayFinishBeginEvent()
void OnStayFinishServerEvent()
void OnStayFinishClientEvent()

References GetDebugName(), GetGame(), OnStayFinishBeginEvent(), OnStayFinishClientEvent(), OnStayFinishEndEvent(), OnStayFinishServerEvent(), and Debug::TriggerLog().

Referenced by Trigger::UpdateInsiders().

◆ StayStart()

void TriggerEvents::StayStart ( int nrOfInsiders)
inlineprotected

Definition at line 54 of file TriggerEvents.c.

55 {
56#ifdef TRIGGER_DEBUG_SPAM
57 Debug.TriggerLog(nrOfInsiders.ToString(), "TriggerEvents", "", "StayStart", GetDebugName(this));
58#endif
59
61
62 if (GetGame().IsServer())
64 else
66
68 }
void OnStayStartBeginEvent(int nrOfInsiders)
void OnStayStartEndEvent(int nrOfInsiders)
void OnStayStartServerEvent(int nrOfInsiders)
void OnStayStartClientEvent(int nrOfInsiders)

References GetDebugName(), GetGame(), OnStayStartBeginEvent(), OnStayStartClientEvent(), OnStayStartEndEvent(), OnStayStartServerEvent(), and Debug::TriggerLog().

Referenced by Trigger::UpdateInsiders().

Member Data Documentation

◆ m_OnEnterInvoker

ref ScriptInvoker TriggerEvents::m_OnEnterInvoker
protected

Definition at line 5 of file TriggerEvents.c.

Referenced by Enter(), and GetOnEnterInvoker().

◆ m_OnLeaveInvoker

ref ScriptInvoker TriggerEvents::m_OnLeaveInvoker
protected

Definition at line 6 of file TriggerEvents.c.

Referenced by GetOnLeaveInvoker(), and Leave().


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