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

Private Member Functions

void OnReceive (int channel)
 
void OnReceiveInt (int channel, int value)
 
void OnReceiveFloat (int channel, float value)
 
void OnReceiveString (int channel, string value)
 
void OnReceiveParam (int channel, Param params)
 This method is called when an object inheriting from this class subscribes to a channel, and a message along with an object reference is broadcast on that channel, if the object was created just for the purpose of relaying information and is not referenced anywhere else, it should be deleted after processing inside this method.
 
void MessageReceiverBase ()
 
void Subscribe (int channel)
 
void Unsubscribe (int channel)
 
void UnsubscribeAll ()
 
void Broadcast (int channel)
 
void BroadcastInt (int channel, int value)
 
void BroadcastFloat (int channel, float value)
 
void BroadcastString (int channel, string value)
 
void BroadcastParam (int channel, Param params)
 
void Log (string message)
 
void AgentBase ()
 
void Init ()
 
int GetAgentType ()
 
float GetDieOffSpeedEx (PlayerBase player)
 
EStatLevels GetPotencyEx (PlayerBase player)
 
float GetInvasibilityEx (PlayerBase player)
 
EStatLevels GetPotency ()
 
float GetDieOffSpeed ()
 
float GetAntiboticsResistance ()
 
float GetAntibioticsResistanceEx (PlayerBase player)
 
float GetInvasibility ()
 
bool GrowDuringAntibioticsAttack (PlayerBase player)
 
float GetDigestibility ()
 
float CalculateAutoinfectProbability (float userprob)
 
bool AutoinfectCheck (float deltaT, PlayerBase player)
 
bool CanAutoinfectPlayer (PlayerBase player)
 
float GetTransferabilityIn ()
 
float GetTransferabilityOut ()
 
float GetTransferabilityAirOut ()
 
int GetMaxCount ()
 
string GetName ()
 
void DisplayElementBase (PlayerBase player)
 
bool IsClientOnly ()
 
bool IsValueChanged ()
 
void UpdateHUD ()
 
int GetNumberOfBits ()
 
void SetValue (int value, int range=0)
 
int GetValue ()
 
int BitToDec (int mask, int index, int length)
 
int GetCompareMask ()
 
int GetType ()
 
int TranslateLevelToStatus (int level)
 

Private Attributes

PluginMessageManager m_ModuleMessageManager
 
string m_System
 
float m_Type = 0
 
float m_Invasibility
 
float m_TransferabilityIn
 
float m_TransferabilityOut
 
float m_Digestibility = 0.1
 
int m_MaxCount = 1
 
float m_AutoinfectProbability = CalculateAutoinfectProbability(0)
 
float m_TransferabilityAirOut
 
float m_AntibioticsResistance = 1
 
EStatLevels m_Potency = EStatLevels.MEDIUM
 
float m_DieOffSpeed = 1
 
int m_Value
 
int m_ValueLast = -99999
 
int m_Key = 0
 
int m_Type = 0
 
int m_Range = 0
 
int m_Colors [7]
 
string m_Labels [7]
 
int m_Pos = 1
 
int NUM_OF_BITS
 
bool m_IsClientOnly = false
 
PlayerBase m_Player
 
PluginPlayerStatus m_ModulePlayerStatus
 

Detailed Description

Definition at line 1 of file MessageReceiverBase.c.

Constructor & Destructor Documentation

◆ MessageReceiverBase()

void MessageReceiverBase::MessageReceiverBase ( )
inlineprivate

Definition at line 14 of file MessageReceiverBase.c.

15 {
16 m_ModuleMessageManager = PluginMessageManager.Cast(GetPlugin(PluginMessageManager));
17 }
PluginBase GetPlugin(typename plugin_type)
PluginMessageManager m_ModuleMessageManager

References GetPlugin(), and m_ModuleMessageManager.

Member Function Documentation

◆ AgentBase()

void MessageReceiverBase::AgentBase ( )
inlineprivate

Definition at line 16 of file AgentBase.c.

17 {
18 Init();
19 }

References AgentBase::Init().

◆ AutoinfectCheck()

bool MessageReceiverBase::AutoinfectCheck ( float deltaT,
PlayerBase player )
inlineprivate

Definition at line 82 of file AgentBase.c.

83 {
84 if (m_AutoinfectProbability == 0.0)
85 return false;
86
88
91 else
92 return false;
93 }
Definition EnMath.c:7
float m_AutoinfectProbability
Definition AgentBase.c:9
bool CanAutoinfectPlayer(PlayerBase player)
Definition AgentBase.c:95
static float RandomFloat01()
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:126

References AgentBase::CanAutoinfectPlayer(), and Math::RandomFloat01().

◆ BitToDec()

int MessageReceiverBase::BitToDec ( int mask,
int index,
int length )
inlineprivate

Definition at line 58 of file DisplayElementBase.c.

59 {
60 int value = mask & (GetCompareMask() << index);
61 value = value >> index;
62 return value;
63 }

◆ Broadcast()

void MessageReceiverBase::Broadcast ( int channel)
inlineprivate

Definition at line 34 of file MessageReceiverBase.c.

35 {
37 }

References m_ModuleMessageManager.

◆ BroadcastFloat()

void MessageReceiverBase::BroadcastFloat ( int channel,
float value )
inlineprivate

Definition at line 44 of file MessageReceiverBase.c.

45 {
46 m_ModuleMessageManager.BroadcastFloat(channel, value);
47 }

References m_ModuleMessageManager.

◆ BroadcastInt()

void MessageReceiverBase::BroadcastInt ( int channel,
int value )
inlineprivate

Definition at line 39 of file MessageReceiverBase.c.

40 {
42 }

References m_ModuleMessageManager.

◆ BroadcastParam()

void MessageReceiverBase::BroadcastParam ( int channel,
Param params )
inlineprivate

Definition at line 54 of file MessageReceiverBase.c.

55 {
56 m_ModuleMessageManager.BroadcastParam(channel, params);
57 }

References m_ModuleMessageManager.

◆ BroadcastString()

void MessageReceiverBase::BroadcastString ( int channel,
string value )
inlineprivate

Definition at line 49 of file MessageReceiverBase.c.

50 {
51 m_ModuleMessageManager.BroadcastString(channel, value);
52 }

References m_ModuleMessageManager.

◆ CalculateAutoinfectProbability()

float MessageReceiverBase::CalculateAutoinfectProbability ( float userprob)
inlineprivate

Definition at line 77 of file AgentBase.c.

78 {
79 return (1 - Math.Pow(1 - userprob, (1 / 1200)));
80 }
static proto float Pow(float v, float power)
Return power of v ^ power.

References Math::Pow().

◆ CanAutoinfectPlayer()

bool MessageReceiverBase::CanAutoinfectPlayer ( PlayerBase player)
inlineprivate

Definition at line 95 of file AgentBase.c.

96 {
97 return false;
98 }

◆ DisplayElementBase()

void MessageReceiverBase::DisplayElementBase ( PlayerBase player)
inlineprivate

Definition at line 17 of file DisplayElementBase.c.

18 {
19 m_System = "VirtualHud";
20 m_ModulePlayerStatus = PluginPlayerStatus.Cast(GetPlugin(PluginPlayerStatus));
22 //SetMaxValue();
23 }
PluginPlayerStatus m_ModulePlayerStatus

References GetPlugin(), m_ModulePlayerStatus, m_Player, and m_System.

◆ GetAgentType()

int MessageReceiverBase::GetAgentType ( )
inlineprivate

Definition at line 23 of file AgentBase.c.

24 {
25 return m_Type;
26 }

References m_Type.

◆ GetAntibioticsResistanceEx()

float MessageReceiverBase::GetAntibioticsResistanceEx ( PlayerBase player)
inlineprivate

Definition at line 57 of file AgentBase.c.

58 {
60 }
float GetAntiboticsResistance()
Definition AgentBase.c:53

◆ GetAntiboticsResistance()

float MessageReceiverBase::GetAntiboticsResistance ( )
inlineprivate

Definition at line 53 of file AgentBase.c.

54 {
56 }
float m_AntibioticsResistance
Definition AgentBase.c:11

◆ GetCompareMask()

int MessageReceiverBase::GetCompareMask ( )
inlineprivate

Definition at line 65 of file DisplayElementBase.c.

66 {
67 int mask = Math.Pow(2, GetNumberOfBits()) - 1;
68 return mask;
69 }

References Math::Pow().

◆ GetDieOffSpeed()

float MessageReceiverBase::GetDieOffSpeed ( )
inlineprivate

Definition at line 48 of file AgentBase.c.

49 {
50 return m_DieOffSpeed;
51 }

◆ GetDieOffSpeedEx()

float MessageReceiverBase::GetDieOffSpeedEx ( PlayerBase player)
inlineprivate

Definition at line 28 of file AgentBase.c.

29 {
30 return GetDieOffSpeed();
31 }
float GetDieOffSpeed()
Definition AgentBase.c:48

◆ GetDigestibility()

float MessageReceiverBase::GetDigestibility ( )
inlineprivate

Definition at line 72 of file AgentBase.c.

73 {
74 return m_Digestibility;
75 }

◆ GetInvasibility()

float MessageReceiverBase::GetInvasibility ( )
inlineprivate

Definition at line 62 of file AgentBase.c.

63 {
64 return m_Invasibility;
65 }

◆ GetInvasibilityEx()

float MessageReceiverBase::GetInvasibilityEx ( PlayerBase player)
inlineprivate

Definition at line 38 of file AgentBase.c.

39 {
40 return GetInvasibility();
41 }
float GetInvasibility()
Definition AgentBase.c:62

◆ GetMaxCount()

int MessageReceiverBase::GetMaxCount ( )
inlineprivate

Definition at line 115 of file AgentBase.c.

116 {
117 return m_MaxCount;
118 }

◆ GetName()

string MessageReceiverBase::GetName ( )
inlineprivate

Definition at line 120 of file AgentBase.c.

121 {
122 return ClassName();
123 }

◆ GetNumberOfBits()

int MessageReceiverBase::GetNumberOfBits ( )
inlineprivate

Definition at line 41 of file DisplayElementBase.c.

42 {
43 return NUM_OF_BITS;
44 }

◆ GetPotency()

EStatLevels MessageReceiverBase::GetPotency ( )
inlineprivate

Definition at line 43 of file AgentBase.c.

44 {
45 return m_Potency;
46 }
EStatLevels m_Potency
Definition AgentBase.c:13

◆ GetPotencyEx()

EStatLevels MessageReceiverBase::GetPotencyEx ( PlayerBase player)
inlineprivate

Definition at line 33 of file AgentBase.c.

34 {
35 return GetPotency();
36 }
EStatLevels GetPotency()
Definition AgentBase.c:43

◆ GetTransferabilityAirOut()

float MessageReceiverBase::GetTransferabilityAirOut ( )
inlineprivate

Definition at line 110 of file AgentBase.c.

111 {
113 }
float m_TransferabilityAirOut
Definition AgentBase.c:10

◆ GetTransferabilityIn()

float MessageReceiverBase::GetTransferabilityIn ( )
inlineprivate

Definition at line 100 of file AgentBase.c.

101 {
102 return m_TransferabilityIn;
103 }
float m_TransferabilityIn
Definition AgentBase.c:5

◆ GetTransferabilityOut()

float MessageReceiverBase::GetTransferabilityOut ( )
inlineprivate

Definition at line 105 of file AgentBase.c.

106 {
108 }
float m_TransferabilityOut
Definition AgentBase.c:6

◆ GetType()

int MessageReceiverBase::GetType ( )
inlineprivate

Definition at line 71 of file DisplayElementBase.c.

72 {
73 return m_Type;
74 }

References m_Type.

◆ GetValue()

int MessageReceiverBase::GetValue ( )
inlineprivate

Definition at line 53 of file DisplayElementBase.c.

54 {
55 return m_Value;
56 }

References m_Value.

◆ GrowDuringAntibioticsAttack()

bool MessageReceiverBase::GrowDuringAntibioticsAttack ( PlayerBase player)
inlineprivate

Definition at line 67 of file AgentBase.c.

68 {
69 return true;//for legacy balancing reasons, set to true by default
70 }

◆ Init()

void MessageReceiverBase::Init ( )
private

◆ IsClientOnly()

bool MessageReceiverBase::IsClientOnly ( )
inlineprivate

Definition at line 26 of file DisplayElementBase.c.

27 {
28 return m_IsClientOnly;
29 }

◆ IsValueChanged()

bool MessageReceiverBase::IsValueChanged ( )
inlineprivate

Definition at line 31 of file DisplayElementBase.c.

32 {
33 return !(m_Value == m_ValueLast);
34 }

References m_Value.

◆ Log()

void MessageReceiverBase::Log ( string message)
inlineprivate

Definition at line 60 of file MessageReceiverBase.c.

61 {
63 }
Definition Debug.c:14
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Definition Debug.c:133

References Debug::Log(), and m_System.

◆ OnReceive()

void MessageReceiverBase::OnReceive ( int channel)
inlineprivate

Definition at line 7 of file MessageReceiverBase.c.

7{}

◆ OnReceiveFloat()

void MessageReceiverBase::OnReceiveFloat ( int channel,
float value )
inlineprivate

Definition at line 9 of file MessageReceiverBase.c.

9{}

◆ OnReceiveInt()

void MessageReceiverBase::OnReceiveInt ( int channel,
int value )
inlineprivate

Definition at line 8 of file MessageReceiverBase.c.

8{}

◆ OnReceiveParam()

void MessageReceiverBase::OnReceiveParam ( int channel,
Param params )
inlineprivate

This method is called when an object inheriting from this class subscribes to a channel, and a message along with an object reference is broadcast on that channel, if the object was created just for the purpose of relaying information and is not referenced anywhere else, it should be deleted after processing inside this method.

Definition at line 12 of file MessageReceiverBase.c.

12{}

◆ OnReceiveString()

void MessageReceiverBase::OnReceiveString ( int channel,
string value )
inlineprivate

Definition at line 10 of file MessageReceiverBase.c.

10{}

◆ SetValue()

void MessageReceiverBase::SetValue ( int value,
int range = 0 )
inlineprivate

Definition at line 46 of file DisplayElementBase.c.

47 {
48 m_Value = value;
49 if (range != 0)
50 m_Range = range;
51 }

References m_Value.

◆ Subscribe()

void MessageReceiverBase::Subscribe ( int channel)
inlineprivate

Definition at line 19 of file MessageReceiverBase.c.

20 {
21 m_ModuleMessageManager.Subscribe(this, channel);
22 }

References m_ModuleMessageManager.

◆ TranslateLevelToStatus()

int MessageReceiverBase::TranslateLevelToStatus ( int level)
inlineprivate

Definition at line 76 of file DisplayElementBase.c.

77 {
78 if (level == DSLevels.WARNING)
79 return 2;
80 if (level == DSLevels.CRITICAL)
81 return 3;
82 if (level == DSLevels.BLINKING)
83 return 4;
84 if (level == DSLevels.EXTRA)
85 return 5;
86 return 1;
87 }
DSLevels

◆ Unsubscribe()

void MessageReceiverBase::Unsubscribe ( int channel)
inlineprivate

Definition at line 24 of file MessageReceiverBase.c.

25 {
27 }
bool IsPluginManagerExists()

References IsPluginManagerExists(), and m_ModuleMessageManager.

◆ UnsubscribeAll()

void MessageReceiverBase::UnsubscribeAll ( )
inlineprivate

Definition at line 29 of file MessageReceiverBase.c.

30 {
31 if (IsPluginManagerExists()) m_ModuleMessageManager.UnsubscribeAll(this);
32 }

References IsPluginManagerExists(), and m_ModuleMessageManager.

◆ UpdateHUD()

void MessageReceiverBase::UpdateHUD ( )
inlineprivate

Definition at line 36 of file DisplayElementBase.c.

37 {
39 }

References m_Value.

Member Data Documentation

◆ m_AntibioticsResistance

float MessageReceiverBase::m_AntibioticsResistance = 1
private

Definition at line 11 of file AgentBase.c.

◆ m_AutoinfectProbability

float MessageReceiverBase::m_AutoinfectProbability = CalculateAutoinfectProbability(0)
private

Definition at line 9 of file AgentBase.c.

◆ m_Colors

int MessageReceiverBase::m_Colors[7]
private

Definition at line 8 of file DisplayElementBase.c.

◆ m_DieOffSpeed

float MessageReceiverBase::m_DieOffSpeed = 1
private

Definition at line 14 of file AgentBase.c.

◆ m_Digestibility

float MessageReceiverBase::m_Digestibility = 0.1
private

Definition at line 7 of file AgentBase.c.

◆ m_Invasibility

float MessageReceiverBase::m_Invasibility
private

Definition at line 4 of file AgentBase.c.

◆ m_IsClientOnly

bool MessageReceiverBase::m_IsClientOnly = false
private

Definition at line 12 of file DisplayElementBase.c.

◆ m_Key

int MessageReceiverBase::m_Key = 0
private

Definition at line 5 of file DisplayElementBase.c.

◆ m_Labels

string MessageReceiverBase::m_Labels[7]
private

Definition at line 9 of file DisplayElementBase.c.

◆ m_MaxCount

int MessageReceiverBase::m_MaxCount = 1
private

Definition at line 8 of file AgentBase.c.

◆ m_ModuleMessageManager

PluginMessageManager MessageReceiverBase::m_ModuleMessageManager
private

◆ m_ModulePlayerStatus

PluginPlayerStatus MessageReceiverBase::m_ModulePlayerStatus
private

Definition at line 15 of file DisplayElementBase.c.

◆ m_Player

PlayerBase MessageReceiverBase::m_Player
private

Definition at line 13 of file DisplayElementBase.c.

◆ m_Pos

int MessageReceiverBase::m_Pos = 1
private

Definition at line 10 of file DisplayElementBase.c.

◆ m_Potency

EStatLevels MessageReceiverBase::m_Potency = EStatLevels.MEDIUM
private

Definition at line 13 of file AgentBase.c.

◆ m_Range

int MessageReceiverBase::m_Range = 0
private

Definition at line 7 of file DisplayElementBase.c.

◆ m_System

string MessageReceiverBase::m_System
private

Definition at line 5 of file MessageReceiverBase.c.

Referenced by Log().

◆ m_TransferabilityAirOut

float MessageReceiverBase::m_TransferabilityAirOut
private

Definition at line 10 of file AgentBase.c.

◆ m_TransferabilityIn

float MessageReceiverBase::m_TransferabilityIn
private

Definition at line 5 of file AgentBase.c.

◆ m_TransferabilityOut

float MessageReceiverBase::m_TransferabilityOut
private

Definition at line 6 of file AgentBase.c.

◆ m_Type [1/2]

float MessageReceiverBase::m_Type = 0
private

Definition at line 3 of file AgentBase.c.

◆ m_Type [2/2]

int MessageReceiverBase::m_Type = 0
private

Definition at line 6 of file DisplayElementBase.c.

◆ m_Value

int MessageReceiverBase::m_Value
private

Definition at line 3 of file DisplayElementBase.c.

◆ m_ValueLast

int MessageReceiverBase::m_ValueLast = -99999
private

Definition at line 4 of file DisplayElementBase.c.

◆ NUM_OF_BITS

int MessageReceiverBase::NUM_OF_BITS
private

Definition at line 11 of file DisplayElementBase.c.


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