Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
remoteplayerdamagedebug.c
Go to the documentation of this file.
2 {
3  const int MAX_DAMAGE_RECORDS = 5;
4  PlayerBase m_Player;
5  bool m_ChangedSinceSerialization;
6 
7  ref array<ref DamageData> m_DamageList = new array<ref DamageData>;
8 
10  {
11  m_Player = player;
12  }
13 
14  void AddDamage(float value_global, float value_blood, float value_shock)
15  {
16  m_ChangedSinceSerialization = true;
17  DamageData damage_data = new DamageData( value_global, value_blood, value_shock );
18  m_DamageList.InsertAt(damage_data,0);
19  if( m_DamageList.Count() > MAX_DAMAGE_RECORDS )
20  {
21  m_DamageList.RemoveOrdered(MAX_DAMAGE_RECORDS);
22  }
23  }
24 
25  void InsertDamageObject(DamageData damage_object)
26  {
27  m_DamageList.Insert(damage_object);
28  }
29 
30 
31  PlayerBase GetPlayer()
32  {
33  return m_Player;
34  }
35 
36 
37  void Get(array<ref DamageData> damage_list)
38  {
39  for(int i = 0; i < m_DamageList.Count(); i++)
40  {
41  damage_list.Insert(m_DamageList.Get(i));
42  }
43  }
44 
45  void GetReversed(array<ref DamageData> damage_list)
46  {
47  int index = m_DamageList.Count() - 1;
48  for(; index >= 0; index--)
49  {
50  damage_list.Insert(m_DamageList.Get(index));
51  }
52  }
53 
54  void Serialize(array<ref RemotePlayerDamageDebug> list)
55  {
56  if( m_ChangedSinceSerialization )
57  {
58  list.Insert(this);
59  }
60  m_ChangedSinceSerialization = false;
61  }
62 
63  void Debug()
64  {
65  string output;
66  for(int i = 0; i < m_DamageList.Count(); i++)
67  {
68  output = output + m_DamageList.Get(i).ToString() + ", ";
69  }
70  PrintString("damage values for player " + m_Player.ToString()+":" + output);
71 
72  }
73 
74 }
PlayerBase
Definition: playerbaseclient.c:1
RemotePlayerDamageDebug
Definition: remoteplayerdamagedebug.c:1
m_Player
DayZPlayer m_Player
Definition: hand_events.c:42
PrintString
void PrintString(string s)
Helper for printing out string expression. Example: PrintString("Hello " + var);.
Definition: enscript.c:345
DamageData
Definition: damagedata.c:1
array< ref DamageData >
Debug
Definition: debug.c:13