Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
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
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}
void Serialize()
Definition inventory.c:201
Definition debug.c:2
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
class array< Class T > PrintString
DayZPlayer m_Player
Definition hand_events.c:42
override float Get()