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

Private Member Functions

void Init ()
 
int GetStorageVersion ()
 
void AutoactivateSymptoms ()
 
void SymptomManager (PlayerBase player)
 
void OnPlayerKilled ()
 
SymptomBase GetSymptomByUID (int SYMPTOM_uid)
 
void ~SymptomManager ()
 
PlayerBase GetPlayer ()
 
void RegisterSymptom (SymptomBase Symptom)
 
void OnAnimationFinished (eAnimFinishType type=eAnimFinishType.SUCCESS)
 
void OnAnimationStarted ()
 
int CreateUniqueID ()
 
bool IsUIDUsed (int uid)
 
string GetSymptomName (int symptom_id)
 
SmptAnimMetaBase SpawnAnimMetaObject (int symptom_id)
 
void RequestSymptomExit (int SYMPTOM_uid)
 Exits a specific Symptom with a given UID.
 
bool IsSymptomPrimary (int symptom_id)
 
void OnInputUserDataReceived (ParamsReadContext ctx)
 
int GetCurrentCommandID ()
 
void OnTick (float deltatime, int pCurrentCommandID, HumanMovementState movement_state)
 
void SetAnimation (ParamsReadContext ctx)
 
void UpdateActiveSymptoms (float deltatime)
 
void OnSymptomExit (SymptomBase Symptom, int uid)
 
int GetSymptomMaxCount (int symptom_id)
 
int GetSymptomCount (int symptom_id)
 
void IncreaseSymptomCount (int symptom_id)
 
void DecreaseSymptomCount (int symptom_id)
 
SymptomBase SpawnSymptom (int symptom_id, int uid=-1)
 
void CleanUpPrimaryQueue ()
 
SymptomBase QueueUpPrimarySymptom (int symptom_id, int uid=-1)
 
void QueueUpSecondarySymptom (int symptom_id, int uid=-1)
 
SymptomBase QueueUpSecondarySymptomEx (int symptom_id, int uid=-1)
 
void RemoveSecondarySymptom (int symptom_id)
 Removes a single Symptom.
 
SymptomBase GetCurrentPrimaryActiveSymptom ()
 
int FindFirstAvailableSymptomIndex ()
 
int ComparePriority (int prio1, int prio2)
 
int GetSymptomPriority (int symptom_id)
 
void OnRPC (int rpc_type, ParamsReadContext ctx)
 
void OnStoreSave (ParamsWriteContext ctx)
 
bool OnStoreLoad (ParamsReadContext ctx, int version)
 

Private Attributes

PlayerBase m_Player
 
ref map< int, ref SymptomBasem_AvailableSymptoms
 
ref map< int, intm_ActiveSymptomTypes
 
ref array< ref SymptomBasem_SymptomQueuePrimary
 
ref array< ref SymptomBasem_SymptomQueueSecondary
 
ref map< int, SymptomBasem_SymptomsUIDs
 
ref array< ref Paramm_SymptomQueueServerDbg
 
ref array< ref Paramm_SymptomQueueServerDbgPrimary
 
ref array< ref Paramm_SymptomQueueServerDbgSecondary
 
ref Timer m_Timer
 
int m_ActiveSymptomIndexPrimary = -1
 
int m_CurrentCommandID
 
const int STORAGE_VERSION = 121
 
bool m_ShowDebug = false
 
bool m_ShowDebug2 = false
 
ref SmptAnimMetaBase m_AnimMeta
 

Detailed Description

Definition at line 42 of file StateManager.c.

Constructor & Destructor Documentation

◆ SymptomManager()

void SymptomManager::SymptomManager ( PlayerBase player)
inlineprivate

Definition at line 101 of file StateManager.c.

102 {
112 Init();
114 }
PlayerBase m_Player
void AutoactivateSymptoms()
ref map< int, int > m_ActiveSymptomTypes
ref map< int, SymptomBase > m_SymptomsUIDs
ref array< ref Param > m_SymptomQueueServerDbg
ref array< ref Param > m_SymptomQueueServerDbgPrimary
ref map< int, ref SymptomBase > m_AvailableSymptoms
ref array< ref SymptomBase > m_SymptomQueueSecondary
ref array< ref SymptomBase > m_SymptomQueuePrimary
ref array< ref Param > m_SymptomQueueServerDbgSecondary

References AutoactivateSymptoms(), Init(), m_ActiveSymptomTypes, m_AvailableSymptoms, m_Player, m_SymptomQueuePrimary, m_SymptomQueueSecondary, m_SymptomQueueServerDbg, m_SymptomQueueServerDbgPrimary, m_SymptomQueueServerDbgSecondary, and m_SymptomsUIDs.

◆ ~SymptomManager()

void SymptomManager::~SymptomManager ( )
inlineprivate

Definition at line 133 of file StateManager.c.

134 {
135 }

Member Function Documentation

◆ AutoactivateSymptoms()

void SymptomManager::AutoactivateSymptoms ( )
inlineprivate

Definition at line 93 of file StateManager.c.

94 {
95 if (GetGame().IsClient())
96 return;
97
98 QueueUpSecondarySymptom(SymptomIDs.SYMPTOM_BLOODLOSS);
99 }
void QueueUpSecondarySymptom(int symptom_id, int uid=-1)
proto native CGame GetGame()

References GetGame(), and QueueUpSecondarySymptom().

Referenced by SymptomManager().

◆ CleanUpPrimaryQueue()

void SymptomManager::CleanUpPrimaryQueue ( )
inlineprivate

Definition at line 411 of file StateManager.c.

412 {
413 for (int i = 0; i < m_SymptomQueuePrimary.Count(); i++)
414 m_SymptomQueuePrimary.Get(i).RequestDestroy();
415
416 }

References m_SymptomQueuePrimary.

Referenced by OnRPC().

◆ ComparePriority()

int SymptomManager::ComparePriority ( int prio1,
int prio2 )
inlineprivate

Definition at line 507 of file StateManager.c.

508 {
509 if (prio1 > prio2)
510 return 1;
511 else if (prio2 > prio1)
512 return 2;
513 return 0;
514 }

Referenced by QueueUpPrimarySymptom().

◆ CreateUniqueID()

int SymptomManager::CreateUniqueID ( )
inlineprivate

Definition at line 169 of file StateManager.c.

170 {
171 int uid = Math.RandomInt(1, 2147483647);
172 if (!IsUIDUsed(uid)) return uid;
173 else return CreateUniqueID();
174 }
Definition EnMath.c:7
bool IsUIDUsed(int uid)
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].

References CreateUniqueID(), IsUIDUsed(), and Math::RandomInt().

Referenced by CreateUniqueID(), and SpawnSymptom().

◆ DecreaseSymptomCount()

void SymptomManager::DecreaseSymptomCount ( int symptom_id)
inlineprivate

Definition at line 379 of file StateManager.c.

380 {
381 if (m_ActiveSymptomTypes.Contains(symptom_id))
382 {
383 if (m_ActiveSymptomTypes.Get(symptom_id) == 1)
385 else
387 }
388 }

References m_ActiveSymptomTypes.

Referenced by OnSymptomExit().

◆ FindFirstAvailableSymptomIndex()

int SymptomManager::FindFirstAvailableSymptomIndex ( )
inlineprivate

Definition at line 497 of file StateManager.c.

498 {
499 for (int i = 0; i < m_SymptomQueuePrimary.Count(); i++)
500 {
501 if (m_SymptomQueuePrimary.Get(i).CanActivate())
502 return i;
503 }
504 return -1;
505 }

References m_SymptomQueuePrimary.

Referenced by OnTick().

◆ GetCurrentCommandID()

int SymptomManager::GetCurrentCommandID ( )
inlineprivate

Definition at line 208 of file StateManager.c.

209 {
210 return m_CurrentCommandID;
211 }

References m_CurrentCommandID.

◆ GetCurrentPrimaryActiveSymptom()

SymptomBase SymptomManager::GetCurrentPrimaryActiveSymptom ( )
inlineprivate

Definition at line 480 of file StateManager.c.

481 {
482 if (GetGame().IsServer())
483 {
485 {
487 }
488 }
489 if (!GetGame().IsDedicatedServer())
490 {
491 if (m_SymptomQueuePrimary.Count() > 0)
492 return m_SymptomQueuePrimary.Get(0);
493 }
494 return NULL;
495 }
int m_ActiveSymptomIndexPrimary

References GetGame(), m_ActiveSymptomIndexPrimary, and m_SymptomQueuePrimary.

Referenced by AnimFinished(), OnAnimationStarted(), and UpdateActiveSymptoms().

◆ GetPlayer()

PlayerBase SymptomManager::GetPlayer ( )
inlineprivate

Definition at line 137 of file StateManager.c.

138 {
139 return m_Player;
140 }

References m_Player.

◆ GetStorageVersion()

int SymptomManager::GetStorageVersion ( )
inlineprivate

Definition at line 87 of file StateManager.c.

88 {
89 return STORAGE_VERSION;
90 }
const int STORAGE_VERSION

References STORAGE_VERSION.

◆ GetSymptomByUID()

SymptomBase SymptomManager::GetSymptomByUID ( int SYMPTOM_uid)
inlineprivate

Definition at line 127 of file StateManager.c.

128 {
129 return m_SymptomsUIDs.Get(SYMPTOM_uid);
130 }

References m_SymptomsUIDs.

◆ GetSymptomCount()

int SymptomManager::GetSymptomCount ( int symptom_id)
inlineprivate

Definition at line 363 of file StateManager.c.

364 {
365 if (m_ActiveSymptomTypes.Contains(symptom_id))
367 else
368 return -1;
369 }

References m_ActiveSymptomTypes.

Referenced by QueueUpPrimarySymptom(), and QueueUpSecondarySymptomEx().

◆ GetSymptomMaxCount()

int SymptomManager::GetSymptomMaxCount ( int symptom_id)
inlineprivate

Definition at line 357 of file StateManager.c.

358 {
359 return m_AvailableSymptoms.Get(symptom_id).GetMaxCount();
360 }

References m_AvailableSymptoms.

Referenced by QueueUpPrimarySymptom(), and QueueUpSecondarySymptomEx().

◆ GetSymptomName()

string SymptomManager::GetSymptomName ( int symptom_id)
inlineprivate

Definition at line 181 of file StateManager.c.

182 {
183 return m_AvailableSymptoms.Get(symptom_id).GetName();
184 }

References m_AvailableSymptoms.

◆ GetSymptomPriority()

int SymptomManager::GetSymptomPriority ( int symptom_id)
inlineprivate

Definition at line 516 of file StateManager.c.

517 {
518 return m_AvailableSymptoms.Get(symptom_id).GetPriority();
519 }

References m_AvailableSymptoms.

Referenced by QueueUpPrimarySymptom().

◆ IncreaseSymptomCount()

void SymptomManager::IncreaseSymptomCount ( int symptom_id)
inlineprivate

Definition at line 371 of file StateManager.c.

372 {
373 if (m_ActiveSymptomTypes.Contains(symptom_id))
375 else
377 }

References m_ActiveSymptomTypes.

Referenced by SpawnSymptom().

◆ Init()

void SymptomManager::Init ( )
inlineprivate

Definition at line 70 of file StateManager.c.

References RegisterSymptom().

Referenced by SymptomManager().

◆ IsSymptomPrimary()

bool SymptomManager::IsSymptomPrimary ( int symptom_id)
inlineprivate

Definition at line 199 of file StateManager.c.

200 {
201 return m_AvailableSymptoms.Get(symptom_id).IsPrimary();
202 }

References m_AvailableSymptoms.

Referenced by OnStoreLoad().

◆ IsUIDUsed()

bool SymptomManager::IsUIDUsed ( int uid)
inlineprivate

Definition at line 176 of file StateManager.c.

177 {
178 return m_SymptomsUIDs.Contains(uid);
179 }

References m_SymptomsUIDs.

Referenced by CreateUniqueID().

◆ OnAnimationFinished()

void SymptomManager::OnAnimationFinished ( eAnimFinishType type = eAnimFinishType.SUCCESS)
inlineprivate

Definition at line 157 of file StateManager.c.

158 {
159 if (m_AnimMeta)
160 m_AnimMeta.AnimFinished(type);
161 }
ref SmptAnimMetaBase m_AnimMeta

References m_AnimMeta.

Referenced by OnTick(), PlayRequest(), and Update().

◆ OnAnimationStarted()

void SymptomManager::OnAnimationStarted ( )
inlineprivate

Definition at line 163 of file StateManager.c.

164 {
167 }
void AnimationStart()
Definition StateBase.c:306
SymptomBase GetCurrentPrimaryActiveSymptom()

References SymptomBase::AnimationStart(), and GetCurrentPrimaryActiveSymptom().

Referenced by Update().

◆ OnInputUserDataReceived()

void SymptomManager::OnInputUserDataReceived ( ParamsReadContext ctx)
inlineprivate

Definition at line 204 of file StateManager.c.

205 {
206 }

◆ OnPlayerKilled()

void SymptomManager::OnPlayerKilled ( )
inlineprivate

Definition at line 116 of file StateManager.c.

117 {
118 for (int i = 0; i < m_SymptomQueuePrimary.Count(); i++)
119 m_SymptomQueuePrimary.Get(i).OnOwnerKilled();
120
121 for (i = 0; i < m_SymptomQueueSecondary.Count(); i++)
122 {
123 if (m_SymptomQueueSecondary.Get(i)) m_SymptomQueueSecondary.Get(i).OnOwnerKilled();
124 }
125 }

References m_SymptomQueuePrimary, and m_SymptomQueueSecondary.

◆ OnRPC()

void SymptomManager::OnRPC ( int rpc_type,
ParamsReadContext ctx )
inlineprivate

Definition at line 521 of file StateManager.c.

522 {
526
527 bool is_primary = m_AvailableSymptoms.Get(symptom_id).IsPrimary();
528
529 if (rpc_type == ERPCs.RPC_PLAYER_SYMPTOM_ON)
530 {
531 if (is_primary)
532 {
535 }
536 else
538 }
539 else if (rpc_type == ERPCs.RPC_PLAYER_SYMPTOM_OFF)
540 {
541 if (is_primary)
543 else
545 }
546 }
ERPCs
Definition ERPCs.c:2
static ref Param2< int, int > PARAM2_INT_INT
void RemoveSecondarySymptom(int symptom_id)
Removes a single Symptom.
SymptomBase QueueUpPrimarySymptom(int symptom_id, int uid=-1)
void CleanUpPrimaryQueue()

References CleanUpPrimaryQueue(), m_AvailableSymptoms, CachedObjectsParams::PARAM2_INT_INT, QueueUpPrimarySymptom(), QueueUpSecondarySymptom(), and RemoveSecondarySymptom().

◆ OnStoreLoad()

bool SymptomManager::OnStoreLoad ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 567 of file StateManager.c.

568 {
570
571 if (ctx.Read(m_SaveQueue))
572 {
573 for (int i = 0; i < m_SaveQueue.Count(); i++)
574 {
575 int id = m_SaveQueue.Get(i);
576
577 if (IsSymptomPrimary(id))
579 else
581 }
582 return true;
583 }
584 else
585 return false;
586 }
bool IsSymptomPrimary(int symptom_id)

References IsSymptomPrimary(), QueueUpPrimarySymptom(), and QueueUpSecondarySymptom().

◆ OnStoreSave()

void SymptomManager::OnStoreSave ( ParamsWriteContext ctx)
inlineprivate

Definition at line 548 of file StateManager.c.

549 {
551
552 for (int i = 0; i < m_SymptomQueuePrimary.Count(); i++)
553 {
554 if (m_SymptomQueuePrimary.Get(i).IsPersistent())
555 m_SaveQueue.Insert(m_SymptomQueuePrimary.Get(i).GetType());
556 }
557
558 for (i = 0; i < m_SymptomQueueSecondary.Count(); i++)
559 {
560 if (m_SymptomQueueSecondary.Get(i).IsPersistent())
561 m_SaveQueue.Insert(m_SymptomQueueSecondary.Get(i).GetType());
562 }
563
564 ctx.Write(m_SaveQueue);
565 }

References m_SymptomQueuePrimary, and m_SymptomQueueSecondary.

◆ OnSymptomExit()

void SymptomManager::OnSymptomExit ( SymptomBase Symptom,
int uid )
inlineprivate

Definition at line 314 of file StateManager.c.

315 {
316 bool is_primary;
317 if (Symptom)
318 {
319 is_primary = Symptom.IsPrimary();
320 DecreaseSymptomCount(Symptom.GetType());
321 }
322
323 if (m_SymptomsUIDs.Contains(uid))
324 m_SymptomsUIDs.Remove(uid);
325 else
326 Debug.LogError("Symptom with this UID does not exist", "PlayerSymptoms");
327
328 if (is_primary)
329 {
330 for (int i = 0; i < m_SymptomQueuePrimary.Count(); i++)
331 {
332 if (m_SymptomQueuePrimary.Get(i) == Symptom)
333 {
334 m_SymptomQueuePrimary.RemoveOrdered(i);
335 break;
336 }
337 }
338 }
339 else
340 {
341 for (i = 0; i < m_SymptomQueueSecondary.Count(); i++)
342 {
344 {
345 m_SymptomQueueSecondary.RemoveOrdered(i);
346 break;
347 }
348 }
349 }
351#ifdef DIAG_DEVELOPER
353#endif
354 }
Definition Debug.c:14
static void LogError(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as error message.
Definition Debug.c:341
void DecreaseSymptomCount(int symptom_id)

References DecreaseSymptomCount(), GetGame(), Debug::LogError(), m_ActiveSymptomIndexPrimary, m_SymptomQueuePrimary, m_SymptomQueueSecondary, and m_SymptomsUIDs.

Referenced by SymptomBase::OnDestructed().

◆ OnTick()

void SymptomManager::OnTick ( float deltatime,
int pCurrentCommandID,
HumanMovementState movement_state )
inlineprivate

Definition at line 213 of file StateManager.c.

214 {
215 // pCurrentCommandID might be the initial value, but the system itself requires
216 // current value, so retrieve the current value from player instead
217 m_CurrentCommandID = m_Player.GetCurrentCommandID();
220
222
223 if (m_AnimMeta)
224 {
225 if (m_AnimMeta.IsDestroyReqested())
227 }
228
229 if (m_AnimMeta)
230 {
231
232 //anim requested
233 if (!m_AnimMeta.IsPlaying())
234 {
235 // not playing yet and not possible to play
237 if (symptom && !symptom.CanActivate())
239 else if (m_AnimMeta.PlayRequest() == EAnimPlayState.FAILED)
241 }
242 else
244 }
245
246#ifdef DIAG_DEVELOPER
247#ifndef SERVER //must be here !!!
248 if (DiagMenu.GetBool(DiagMenuIDs.MISC_PLAYER_SYMPTOMS_SHOW))
249 {
250 //DisplayDebug(true);
253
254 DisplayDebug1("Symptoms Client", 50, primary_debug, secondary_debug);
257 }
258 else
259 {
260 CleanDebug1("Symptoms Client", 50);
261 CleanDebug2("Symptoms Server", 300);
263 }
264#endif
265#endif
266 }
DiagMenuIDs
Definition EDiagMenuIDs.c:2
eAnimFinishType
Definition SmptAnimMeta.c:2
EAnimPlayState
void OnAnimationFinished(eAnimFinishType type=eAnimFinishType.SUCCESS)
void UpdateActiveSymptoms(float deltatime)
int FindFirstAvailableSymptomIndex()
static proto bool GetBool(int id, bool reverse=false)
Get value as bool from the given script id.

References FindFirstAvailableSymptomIndex(), DiagMenu::GetBool(), m_ActiveSymptomIndexPrimary, m_AnimMeta, m_AvailableSymptoms, m_CurrentCommandID, m_Player, m_SymptomQueuePrimary, m_SymptomQueueSecondary, m_SymptomQueueServerDbgPrimary, m_SymptomQueueServerDbgSecondary, OnAnimationFinished(), and UpdateActiveSymptoms().

◆ QueueUpPrimarySymptom()

SymptomBase SymptomManager::QueueUpPrimarySymptom ( int symptom_id,
int uid = -1 )
inlineprivate

Definition at line 418 of file StateManager.c.

419 {
422 return null;
423 for (int i = 0; i < m_SymptomQueuePrimary.Count(); i++)
424 {
425 if (m_SymptomQueuePrimary.Get(i).CanBeInterupted() && ComparePriority(GetSymptomPriority(symptom_id), m_SymptomQueuePrimary.Get(i).GetPriority()) == 1)
426 {
429
431 {
432 m_SymptomQueuePrimary.Get(MAX_QUEUE_SIZE).RequestDestroy();// no need to remove from the array, that's done via Symptom callback on destruct
433 }
434 break;
435 }
436 }
438 {
441 }
442#ifdef DIAG_DEVELOPER
444#endif
445 return Symptom;
446 }
const int MAX_QUEUE_SIZE
int GetSymptomCount(int symptom_id)
int GetSymptomMaxCount(int symptom_id)
int GetSymptomPriority(int symptom_id)
SymptomBase SpawnSymptom(int symptom_id, int uid=-1)
int ComparePriority(int prio1, int prio2)

References ComparePriority(), GetSymptomCount(), GetSymptomMaxCount(), GetSymptomPriority(), m_SymptomQueuePrimary, MAX_QUEUE_SIZE, and SpawnSymptom().

Referenced by OnRPC(), and OnStoreLoad().

◆ QueueUpSecondarySymptom()

void SymptomManager::QueueUpSecondarySymptom ( int symptom_id,
int uid = -1 )
inlineprivate

Definition at line 448 of file StateManager.c.

449 {
451 }
SymptomBase QueueUpSecondarySymptomEx(int symptom_id, int uid=-1)

References QueueUpSecondarySymptomEx().

Referenced by AutoactivateSymptoms(), OnRPC(), and OnStoreLoad().

◆ QueueUpSecondarySymptomEx()

SymptomBase SymptomManager::QueueUpSecondarySymptomEx ( int symptom_id,
int uid = -1 )
inlineprivate

Definition at line 453 of file StateManager.c.

454 {
456 return null;
457
458 if (m_AvailableSymptoms.Get(symptom_id).IsPrimary())
459 return null;
460
462
464 return Symptom;
465 }

References GetSymptomCount(), GetSymptomMaxCount(), m_AvailableSymptoms, m_SymptomQueueSecondary, and SpawnSymptom().

Referenced by QueueUpSecondarySymptom().

◆ RegisterSymptom()

void SymptomManager::RegisterSymptom ( SymptomBase Symptom)
inlineprivate

Definition at line 142 of file StateManager.c.

143 {
144 Symptom.Init(this, m_Player, 0);
145 int id = Symptom.GetType();
146
147 if (m_AvailableSymptoms.Contains(id))
148 {
149 Error("SymptomBase Symptom already registered !");
150 return;
151 }
152
153 m_AvailableSymptoms.Insert(id, Symptom);
154 //PrintString("inserting id: "+ToString(id));
155 }
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

References Error(), m_AvailableSymptoms, and m_Player.

Referenced by Init().

◆ RemoveSecondarySymptom()

void SymptomManager::RemoveSecondarySymptom ( int symptom_id)
inlineprivate

Removes a single Symptom.

Definition at line 468 of file StateManager.c.

469 {
470 for (int i = 0; i < m_SymptomQueueSecondary.Count(); i++)
471 {
472 if (m_SymptomQueueSecondary.Get(i) && m_SymptomQueueSecondary.Get(i).GetType() == symptom_id)
473 {
474 m_SymptomQueueSecondary.Get(i).RequestDestroy();
475 return;
476 }
477 }
478 }

References m_SymptomQueueSecondary.

Referenced by OnRPC().

◆ RequestSymptomExit()

void SymptomManager::RequestSymptomExit ( int SYMPTOM_uid)
inlineprivate

Exits a specific Symptom with a given UID.

Definition at line 194 of file StateManager.c.

195 {
196 if (m_SymptomsUIDs.Get(SYMPTOM_uid)) m_SymptomsUIDs.Get(SYMPTOM_uid).RequestDestroy();
197 }

References m_SymptomsUIDs.

◆ SetAnimation()

void SymptomManager::SetAnimation ( ParamsReadContext ctx)
inlineprivate

Definition at line 268 of file StateManager.c.

269 {
270 if (m_AnimMeta)
271 {
272 // animation meta already exists
273 // pass
274 }
275 else
276 {
277 int state_type;
278 if (ctx.Read(state_type))
279 {
281 if (m_AnimMeta)
282 m_AnimMeta.Init(ctx, this, m_Player);
283 }
284 }
285 }
SmptAnimMetaBase SpawnAnimMetaObject(int symptom_id)

References m_AnimMeta, m_Player, and SpawnAnimMetaObject().

◆ SpawnAnimMetaObject()

SmptAnimMetaBase SymptomManager::SpawnAnimMetaObject ( int symptom_id)
inlineprivate

Definition at line 186 of file StateManager.c.

187 {
188 SmptAnimMetaBase animMeta = m_AvailableSymptoms.Get(symptom_id).SpawnAnimMetaObject();
189 animMeta.m_StateType = symptom_id;
190 return animMeta;
191 }

References m_AvailableSymptoms.

Referenced by SetAnimation().

◆ SpawnSymptom()

SymptomBase SymptomManager::SpawnSymptom ( int symptom_id,
int uid = -1 )
inlineprivate

Definition at line 390 of file StateManager.c.

391 {
393 {
394 SymptomBase Symptom = SymptomBase.Cast(m_AvailableSymptoms.Get(symptom_id).ClassName().ToType().Spawn());
395 if (uid == -1)
397 Symptom.Init(this, m_Player, uid);
398 if (m_SymptomsUIDs.Contains(uid))
399 Error("Symptoms: Unique ID already exists !");
400 m_SymptomsUIDs.Insert(uid, Symptom);
402 return Symptom;
403 }
404
405 if (!Symptom)
406 Error("Symptom not registered");
407
408 return NULL;
409 }
void IncreaseSymptomCount(int symptom_id)

References CreateUniqueID(), Error(), IncreaseSymptomCount(), m_AvailableSymptoms, m_Player, and m_SymptomsUIDs.

Referenced by QueueUpPrimarySymptom(), and QueueUpSecondarySymptomEx().

◆ UpdateActiveSymptoms()

void SymptomManager::UpdateActiveSymptoms ( float deltatime)
inlineprivate

Definition at line 287 of file StateManager.c.

288 {
289 //if( GetGame().IsClient() && !m_Player.IsPlayer() ) return;
290 //primary
292 {
293 if (!GetCurrentPrimaryActiveSymptom().IsActivated())
294 {
295 if (GetCurrentPrimaryActiveSymptom().CanActivate())
297 }
298 if (GetCurrentPrimaryActiveSymptom().IsActivated())
300 }
301 //secondary
302 for (int i = 0; i < m_SymptomQueueSecondary.Count(); i++)
303 {
304 if (m_SymptomQueueSecondary.Get(i) && !m_SymptomQueueSecondary.Get(i).IsActivated())
305 m_SymptomQueueSecondary.Get(i).Activate();
306 else
307 {
309 }
310 }
311 }
void Activate()
Definition StateBase.c:161
void Update(float deltatime)
Definition StateBase.c:201

References SymptomBase::Activate(), GetCurrentPrimaryActiveSymptom(), m_SymptomQueueSecondary, and SymptomBase::Update().

Referenced by OnTick().

Member Data Documentation

◆ m_ActiveSymptomIndexPrimary

int SymptomManager::m_ActiveSymptomIndexPrimary = -1
private

Definition at line 60 of file StateManager.c.

Referenced by GetCurrentPrimaryActiveSymptom(), OnSymptomExit(), and OnTick().

◆ m_ActiveSymptomTypes

ref map<int, int> SymptomManager::m_ActiveSymptomTypes
private

◆ m_AnimMeta

ref SmptAnimMetaBase SymptomManager::m_AnimMeta
private

Definition at line 68 of file StateManager.c.

Referenced by OnAnimationFinished(), OnTick(), and SetAnimation().

◆ m_AvailableSymptoms

◆ m_CurrentCommandID

int SymptomManager::m_CurrentCommandID
private

Definition at line 61 of file StateManager.c.

Referenced by GetCurrentCommandID(), and OnTick().

◆ m_Player

PlayerBase SymptomManager::m_Player
private

◆ m_ShowDebug

bool SymptomManager::m_ShowDebug = false
private

Definition at line 65 of file StateManager.c.

◆ m_ShowDebug2

bool SymptomManager::m_ShowDebug2 = false
private

Definition at line 66 of file StateManager.c.

◆ m_SymptomQueuePrimary

◆ m_SymptomQueueSecondary

◆ m_SymptomQueueServerDbg

ref array<ref Param> SymptomManager::m_SymptomQueueServerDbg
private

Definition at line 54 of file StateManager.c.

Referenced by SymptomManager().

◆ m_SymptomQueueServerDbgPrimary

ref array<ref Param> SymptomManager::m_SymptomQueueServerDbgPrimary
private

Definition at line 55 of file StateManager.c.

Referenced by OnTick(), and SymptomManager().

◆ m_SymptomQueueServerDbgSecondary

ref array<ref Param> SymptomManager::m_SymptomQueueServerDbgSecondary
private

Definition at line 56 of file StateManager.c.

Referenced by OnTick(), and SymptomManager().

◆ m_SymptomsUIDs

ref map<int, SymptomBase > SymptomManager::m_SymptomsUIDs
private

◆ m_Timer

ref Timer SymptomManager::m_Timer
private

Definition at line 58 of file StateManager.c.

◆ STORAGE_VERSION

const int SymptomManager::STORAGE_VERSION = 121
private

Definition at line 63 of file StateManager.c.

Referenced by GetStorageVersion().


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