DayZ 1.24
Loading...
Searching...
No Matches
NotifiersManager.c File Reference

Go to the source code of this file.

Enumerations

enum  eNotifiers {
  NTF_HEALTHY , NTF_BLEEDISH , NTF_HUNGRY , NTF_THIRSTY ,
  NTF_STUFFED , NTF_SICK , NTF_WETNESS , NTF_WARMTH ,
  NTF_FEVERISH , NTF_BLOOD , NTF_LIVES , NTF_STAMINA ,
  NTF_PILLS , NTF_HEARTBEAT , NTF_FRACTURE , NTF_LEGS ,
  NTF_COUNT
}
 

Functions

void NotifiersManager (PlayerBase player)
 
void Init ()
 Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)
 
void RegisterItself (int notifier_id, NotifierBase modifier)
 
PlayerBase GetPlayer ()
 
VirtualHud GetVirtualHud ()
 
NotifierBase FindNotifier (int type)
 
void ActivateByType (int notifier, bool triggerEvent=true)
 
void DeactivateByType (int notifier, bool triggerEvent=true)
 
void OnScheduledTick ()
 
void TickNotifiers ()
 

Variables

enum eNotifiers MAX_COUNT = 64
 
ref array< ref NotifierBasem_Notifiers
 
ref NotifierBase m_NotifiersStatic [MAX_COUNT]
 
PlayerBase m_Player
 
ref VirtualHud m_VirtualHud
 
int m_MinTickTime
 
string m_System = "Notifiers"
 

Enumeration Type Documentation

◆ eNotifiers

Enumerator
NTF_HEALTHY 
NTF_BLEEDISH 
NTF_HUNGRY 
NTF_THIRSTY 
NTF_STUFFED 
NTF_SICK 
NTF_WETNESS 
NTF_WARMTH 
NTF_FEVERISH 
NTF_BLOOD 
NTF_LIVES 
NTF_STAMINA 
NTF_PILLS 
NTF_HEARTBEAT 
NTF_FRACTURE 
NTF_LEGS 
NTF_COUNT 

Definition at line 1 of file NotifiersManager.c.

2{
15 //NTF_AGENT_INFECTION,
20 //----------------------------
21 NTF_COUNT,// !!! LAST ITEM !!!
22
23}
@ NTF_HEALTHY
@ NTF_HEARTBEAT
@ NTF_BLOOD
@ NTF_THIRSTY
@ NTF_STAMINA
@ NTF_LEGS
@ NTF_FRACTURE
@ NTF_STUFFED
@ NTF_WETNESS
@ NTF_COUNT
@ NTF_PILLS
@ NTF_SICK
@ NTF_WARMTH
@ NTF_FEVERISH
@ NTF_LIVES
@ NTF_BLEEDISH
@ NTF_HUNGRY

Function Documentation

◆ ActivateByType()

void ActivateByType ( int notifier,
bool triggerEvent = true )

Definition at line 87 of file NotifiersManager.c.

88 {
90 }
NotifierBase FindNotifier(int type)
void SetActive(bool state)

References FindNotifier(), and NotifierBase::SetActive().

◆ DeactivateByType()

void DeactivateByType ( int notifier,
bool triggerEvent = true )

Definition at line 92 of file NotifiersManager.c.

93 {
95 }

References FindNotifier(), and NotifierBase::SetActive().

◆ FindNotifier()

NotifierBase FindNotifier ( int type)

Definition at line 82 of file NotifiersManager.c.

83 {
84 return m_NotifiersStatic[type];
85 }
ref NotifierBase m_NotifiersStatic[MAX_COUNT]

References m_NotifiersStatic.

Referenced by ActivateByType(), and DeactivateByType().

◆ GetPlayer()

PlayerBase GetPlayer ( )

Definition at line 72 of file NotifiersManager.c.

73 {
74 return m_Player;
75 }
PlayerBase m_Player

References m_Player.

◆ GetVirtualHud()

VirtualHud GetVirtualHud ( )

Definition at line 77 of file NotifiersManager.c.

78 {
79 return m_VirtualHud;
80 }
ref VirtualHud m_VirtualHud

References m_VirtualHud.

Referenced by ManBase::OnBleedingSourceAdded(), ManBase::OnBleedingSourceRemoved(), and ManBase::OnRPC().

◆ Init()

void Init ( )

Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)

Definition at line 46 of file NotifiersManager.c.

47 {
48 m_Notifiers.Insert(new HungerNotfr(this));
49 m_Notifiers.Insert(new ThirstNotfr(this));
50 m_Notifiers.Insert(new WarmthNotfr(this));
51 m_Notifiers.Insert(new WetnessNotfr(this));
52 m_Notifiers.Insert(new HealthNotfr(this));
53 m_Notifiers.Insert(new FeverNotfr(this));
54 m_Notifiers.Insert(new SickNotfr(this));
55 m_Notifiers.Insert(new StuffedNotfr(this));
56 m_Notifiers.Insert(new BloodNotfr(this));
57 m_Notifiers.Insert(new PillsNotfr(this));
58 m_Notifiers.Insert(new HeartbeatNotfr(this));
59 m_Notifiers.Insert(new FracturedLegNotfr(this));
60 m_Notifiers.Insert(new InjuredLegNotfr(this));
61
62 }
ref array< ref NotifierBase > m_Notifiers

References m_Notifiers.

◆ NotifiersManager()

void NotifiersManager ( PlayerBase player)

Definition at line 36 of file NotifiersManager.c.

37 {
39
41
43 Init();
44 }
void Init()
Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside o...
int m_MinTickTime
const int MIN_TICK_NOTIFIERS
Definition constants.c:341

References Init(), m_MinTickTime, m_Notifiers, m_Player, and MIN_TICK_NOTIFIERS.

Referenced by ManBase::Init().

◆ OnScheduledTick()

void OnScheduledTick ( )

Definition at line 97 of file NotifiersManager.c.

98 {
99 if (!GetPlayer().IsPlayerSelected()) return;
100
102 }
void TickNotifiers()
PlayerBase GetPlayer()

References GetPlayer(), and TickNotifiers().

Referenced by ManBase::OnTick().

◆ RegisterItself()

void RegisterItself ( int notifier_id,
NotifierBase modifier )

Definition at line 64 of file NotifiersManager.c.

65 {
67 Error("out of bounds for notifier id: " + notifier_id);
68 else
70 }
enum eNotifiers MAX_COUNT
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

References Error(), m_NotifiersStatic, and MAX_COUNT.

◆ TickNotifiers()

void TickNotifiers ( )

Definition at line 104 of file NotifiersManager.c.

105 {
106 int current_time = GetGame().GetTime();
107
109 {
110 if (notifier.IsActive() && notifier.IsTimeToTick(current_time))
111 notifier.OnTick(current_time);
112 }
113
114 }
proto native CGame GetGame()

References GetGame(), and m_Notifiers.

Referenced by OnScheduledTick().

Variable Documentation

◆ m_MinTickTime

int m_MinTickTime

Definition at line 33 of file NotifiersManager.c.

Referenced by NotifiersManager().

◆ m_Notifiers

◆ m_NotifiersStatic

ref NotifierBase m_NotifiersStatic[MAX_COUNT]

Definition at line 30 of file NotifiersManager.c.

Referenced by FindNotifier(), and RegisterItself().

◆ m_Player

PlayerBase m_Player

Definition at line 31 of file NotifiersManager.c.

◆ m_System

string m_System = "Notifiers"

Definition at line 34 of file NotifiersManager.c.

◆ m_VirtualHud

◆ MAX_COUNT

enum eNotifiers MAX_COUNT = 64

Referenced by RegisterItself().