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

Private Member Functions

void Land_Underground_EntranceBase ()
 
void CreateLights ()
 
void ~Land_Underground_EntranceBase ()
 
void CleanUpOnDeleteClient ()
 
void CleanUpOnClosedClient ()
 
bool CanManipulate (Param param=null)
 
void Manipulate (Param param=null)
 
void NavmeshUpdate ()
 
void OnUpdateClient (float timeSlice)
 
override void EOnPostSimulate (IEntity other, float timeSlice)
 
void OnUpdateServer ()
 
void GetConnectedPanels (array< Land_Underground_Panel > panels)
 
bool CheckShouldPlayPersistent (EUndegroundEntranceState state, EUndegroundEntranceState lastValidState)
 
float AdjustTime (float originalTime, float adjustedTime=-1)
 
float GetOpeningTime ()
 
void RequestLatentTransition (float time, EUndegroundEntranceState targetState=EUndegroundEntranceState.UNINITIALIZED)
 
void SetDoorStateServer (EUndegroundEntranceState newState)
 
void OnDoorStateChangedServer (EUndegroundEntranceState newState)
 
void OnDoorStateChangedClient (EUndegroundEntranceState newState, EUndegroundEntranceState prevState)
 
void OpenServer (bool force=false)
 
void HandleVisualPlayback (EUndegroundEntranceState newState, EUndegroundEntranceState prevState)
 
void HandleAudioPlayback (EUndegroundEntranceState newState, EUndegroundEntranceState prevState)
 
void OnFinishedTimerServer ()
 
override void OnVariablesSynchronized ()
 
bool IsInitDoorStateSync ()
 

Private Attributes

EUndegroundEntranceState m_DoorState = EUndegroundEntranceState.CLOSED
 
EUndegroundEntranceState m_DoorStatePrev = EUndegroundEntranceState.UNINITIALIZED
 
float m_AnimPhase
 
ref AnimationTimer m_AnimTimerDoorServer
 
ref Timer m_NavmeshTimer
 
ref array< Land_Underground_Panelm_ConnectedPanels
 
EUndegroundDoorType m_DoorType
 
EntranceLight m_InteriorLight1
 
EntranceLight m_InteriorLight2
 
EntranceLight m_InteriorLight3
 

Detailed Description

Definition at line 51 of file Land_Underground_Entrance.c.

Constructor & Destructor Documentation

◆ Land_Underground_EntranceBase()

void Land_Underground_EntranceBase::Land_Underground_EntranceBase ( )
inlineprivate

Definition at line 65 of file Land_Underground_Entrance.c.

66 {
68 Land_Underground_Panel.RegisterEntrance(this);
69 RegisterNetSyncVariableFloat("m_AnimPhase", 0, 1, 5);
70 RegisterNetSyncVariableInt("m_DoorState", 0, EnumTools.GetLastEnumValue(EUndegroundEntranceState));
71
72#ifndef SERVER
73 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(CreateLights, 250);
74#endif
75 }
static int GetLastEnumValue(typename e)
Return amount of values in enum.
Definition EnConvert.c:644
proto native CGame GetGame()
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8

References CALL_CATEGORY_SYSTEM, CreateLights(), GetGame(), EnumTools::GetLastEnumValue(), and m_DoorType.

◆ ~Land_Underground_EntranceBase()

void Land_Underground_EntranceBase::~Land_Underground_EntranceBase ( )
inlineprivate

Definition at line 79 of file Land_Underground_Entrance.c.

80 {
81 Land_Underground_Panel.UnregisterEntrance(this);
82#ifndef SERVER
84#endif
85 }

References CleanUpOnDeleteClient().

Member Function Documentation

◆ AdjustTime()

float Land_Underground_EntranceBase::AdjustTime ( float originalTime,
float adjustedTime = -1 )
inlineprivate

Definition at line 150 of file Land_Underground_Entrance.c.

151 {
152#ifdef DIAG_DEVELOPER
153 float timeAccel = 1;
154
155 if (adjustedTime != -1)
156 return adjustedTime;
157 if (FeatureTimeAccel.GetFeatureTimeAccelEnabled(ETimeAccelCategories.UNDERGROUND_ENTRANCE))
158 {
159 timeAccel = FeatureTimeAccel.GetFeatureTimeAccelValue();
160 return originalTime / timeAccel;
161 }
162#endif
163 return originalTime;
164 }

Referenced by Land_Underground_Stairs_Exit::GetOpeningTime(), Land_Underground_Stairs_Exit::OnDoorStateChangedServer(), and OnUpdateServer().

◆ CanManipulate()

bool Land_Underground_EntranceBase::CanManipulate ( Param param = null)
inlineprivate

Definition at line 98 of file Land_Underground_Entrance.c.

99 {
100 return m_DoorState == EUndegroundEntranceState.CLOSED;
101 }

References m_DoorState.

Referenced by CanInteract().

◆ CheckShouldPlayPersistent()

bool Land_Underground_EntranceBase::CheckShouldPlayPersistent ( EUndegroundEntranceState state,
EUndegroundEntranceState lastValidState )
inlineprivate

◆ CleanUpOnClosedClient()

void Land_Underground_EntranceBase::CleanUpOnClosedClient ( )
private

◆ CleanUpOnDeleteClient()

void Land_Underground_EntranceBase::CleanUpOnDeleteClient ( )
inlineprivate

Definition at line 89 of file Land_Underground_Entrance.c.

90 {
91 //anything we might have started playing when the door was activated
93 }

References CleanUpOnClosedClient().

Referenced by ~Land_Underground_EntranceBase().

◆ CreateLights()

void Land_Underground_EntranceBase::CreateLights ( )
private

◆ EOnPostSimulate()

override void Land_Underground_EntranceBase::EOnPostSimulate ( IEntity other,
float timeSlice )
inlineprivate

Definition at line 114 of file Land_Underground_Entrance.c.

115 {
116#ifndef SERVER
118#endif
119 }
void OnUpdateClient(float timeSlice)

References OnUpdateClient().

◆ GetConnectedPanels()

void Land_Underground_EntranceBase::GetConnectedPanels ( array< Land_Underground_Panel > panels)
inlineprivate

Definition at line 131 of file Land_Underground_Entrance.c.

132 {
133 if (!Land_Underground_Panel.m_Panels)
134 return;
135 foreach (Land_Underground_Panel p: Land_Underground_Panel.m_Panels)
136 {
137 if (p.GetClosestDoor() == this)
138 panels.Insert(p);
139 }
140 }
static ref set< Land_Underground_Panel > m_Panels

Referenced by OnDoorStateChangedClient().

◆ GetOpeningTime()

float Land_Underground_EntranceBase::GetOpeningTime ( )
inlineprivate

Definition at line 166 of file Land_Underground_Entrance.c.

167 {
168 return 30;
169 }

Referenced by OnUpdateServer().

◆ HandleAudioPlayback()

void Land_Underground_EntranceBase::HandleAudioPlayback ( EUndegroundEntranceState newState,
EUndegroundEntranceState prevState )
private

◆ HandleVisualPlayback()

void Land_Underground_EntranceBase::HandleVisualPlayback ( EUndegroundEntranceState newState,
EUndegroundEntranceState prevState )
private

◆ IsInitDoorStateSync()

bool Land_Underground_EntranceBase::IsInitDoorStateSync ( )
inlineprivate

Definition at line 232 of file Land_Underground_Entrance.c.

233 {
234 return m_DoorStatePrev == EUndegroundEntranceState.UNINITIALIZED;
235 }
EUndegroundEntranceState m_DoorStatePrev

References m_DoorStatePrev.

Referenced by CheckShouldPlayPersistent().

◆ Manipulate()

void Land_Underground_EntranceBase::Manipulate ( Param param = null)
inlineprivate

Definition at line 103 of file Land_Underground_Entrance.c.

104 {
105 OpenServer();
106 }

References OpenServer().

Referenced by Interact().

◆ NavmeshUpdate()

void Land_Underground_EntranceBase::NavmeshUpdate ( )
inlineprivate

Definition at line 108 of file Land_Underground_Entrance.c.

109 {
110 }

◆ OnDoorStateChangedClient()

void Land_Underground_EntranceBase::OnDoorStateChangedClient ( EUndegroundEntranceState newState,
EUndegroundEntranceState prevState )
inlineprivate

Definition at line 187 of file Land_Underground_Entrance.c.

188 {
190 SetEventMask(EntityEvent.POSTSIMULATE);
191 else
192 {
193 ClearEventMask(EntityEvent.POSTSIMULATE);
195 }
196
199
201 {
204 }
205 foreach (Land_Underground_Panel p: m_ConnectedPanels)
207 }
void GetConnectedPanels(array< Land_Underground_Panel > panels)
void OnDoorStateChangedClient(EUndegroundEntranceState newState, EUndegroundEntranceState prevState)
ref array< Land_Underground_Panel > m_ConnectedPanels
void HandleAudioPlayback(EUndegroundEntranceState newState, EUndegroundEntranceState prevState)
void HandleVisualPlayback(EUndegroundEntranceState newState, EUndegroundEntranceState prevState)
EntityEvent
Entity events for event-mask, or throwing event from code.
Definition EnEntity.c:44

References CleanUpOnClosedClient(), GetConnectedPanels(), HandleAudioPlayback(), HandleVisualPlayback(), and m_ConnectedPanels.

Referenced by OnVariablesSynchronized().

◆ OnDoorStateChangedServer()

void Land_Underground_EntranceBase::OnDoorStateChangedServer ( EUndegroundEntranceState newState)
private

Referenced by SetDoorStateServer().

◆ OnFinishedTimerServer()

void Land_Underground_EntranceBase::OnFinishedTimerServer ( )
private

◆ OnUpdateClient()

void Land_Underground_EntranceBase::OnUpdateClient ( float timeSlice)
private

Referenced by EOnPostSimulate().

◆ OnUpdateServer()

void Land_Underground_EntranceBase::OnUpdateServer ( )
inlineprivate

Definition at line 121 of file Land_Underground_Entrance.c.

122 {
123 m_AnimPhase = m_AnimTimerDoorServer.GetValue() / AdjustTime(GetOpeningTime());// make 0..1
124 SetAnimationPhaseNow("EntranceDoor", m_AnimPhase);
125
126 GetGame().GetWorld().UpdatePathgraphDoorByAnimationSourceName(this, "EntranceDoor");
127
128 SetSynchDirty();
129 }
float AdjustTime(float originalTime, float adjustedTime=-1)

References AdjustTime(), GetGame(), GetOpeningTime(), m_AnimPhase, and m_AnimTimerDoorServer.

◆ OnVariablesSynchronized()

override void Land_Underground_EntranceBase::OnVariablesSynchronized ( )
inlineprivate

Definition at line 221 of file Land_Underground_Entrance.c.

222 {
223 super.OnVariablesSynchronized();
224
226 {
229 }
230 }

References m_DoorState, m_DoorStatePrev, and OnDoorStateChangedClient().

◆ OpenServer()

void Land_Underground_EntranceBase::OpenServer ( bool force = false)
inlineprivate

Definition at line 209 of file Land_Underground_Entrance.c.

210 {
211 GetGame().RegisterNetworkStaticObject(this);
214 }
void SetDoorStateServer(EUndegroundEntranceState newState)

References GetGame(), m_DoorState, and SetDoorStateServer().

Referenced by Manipulate().

◆ RequestLatentTransition()

void Land_Underground_EntranceBase::RequestLatentTransition ( float time,
EUndegroundEntranceState targetState = EUndegroundEntranceState.UNINITIALIZED )
inlineprivate

Definition at line 171 of file Land_Underground_Entrance.c.

172 {
173 if (targetState == EUndegroundEntranceState.UNINITIALIZED)
175 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(SetDoorStateServer, time * 1000, false, targetState);
176 }

References CALL_CATEGORY_SYSTEM, GetGame(), m_DoorState, and SetDoorStateServer().

Referenced by Land_Underground_Stairs_Exit::OnDoorStateChangedServer().

◆ SetDoorStateServer()

void Land_Underground_EntranceBase::SetDoorStateServer ( EUndegroundEntranceState newState)
inlineprivate

Definition at line 178 of file Land_Underground_Entrance.c.

179 {
182 SetSynchDirty();
183 }
void OnDoorStateChangedServer(EUndegroundEntranceState newState)

References m_DoorState, and OnDoorStateChangedServer().

Referenced by OpenServer(), and RequestLatentTransition().

Member Data Documentation

◆ m_AnimPhase

float Land_Underground_EntranceBase::m_AnimPhase
private

Definition at line 55 of file Land_Underground_Entrance.c.

Referenced by OnUpdateServer().

◆ m_AnimTimerDoorServer

ref AnimationTimer Land_Underground_EntranceBase::m_AnimTimerDoorServer
private

◆ m_ConnectedPanels

ref array<Land_Underground_Panel> Land_Underground_EntranceBase::m_ConnectedPanels
private

Definition at line 58 of file Land_Underground_Entrance.c.

Referenced by OnDoorStateChangedClient().

◆ m_DoorState

EUndegroundEntranceState Land_Underground_EntranceBase::m_DoorState = EUndegroundEntranceState.CLOSED
private

◆ m_DoorStatePrev

EUndegroundEntranceState Land_Underground_EntranceBase::m_DoorStatePrev = EUndegroundEntranceState.UNINITIALIZED
private

Definition at line 54 of file Land_Underground_Entrance.c.

Referenced by IsInitDoorStateSync(), and OnVariablesSynchronized().

◆ m_DoorType

EUndegroundDoorType Land_Underground_EntranceBase::m_DoorType
private

◆ m_InteriorLight1

EntranceLight Land_Underground_EntranceBase::m_InteriorLight1
private

◆ m_InteriorLight2

EntranceLight Land_Underground_EntranceBase::m_InteriorLight2
private

◆ m_InteriorLight3

EntranceLight Land_Underground_EntranceBase::m_InteriorLight3
private

Definition at line 63 of file Land_Underground_Entrance.c.

◆ m_NavmeshTimer

ref Timer Land_Underground_EntranceBase::m_NavmeshTimer
private

Definition at line 57 of file Land_Underground_Entrance.c.


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