Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
TreePartSynchronizationData.c
Go to the documentation of this file.
1class SCR_TreePartSynchronizationData
2{
3 int m_iTreePartIndex;
4 float m_fQuaternion[4];
5 vector m_vPosition;
6 vector m_vVelocity;
7 vector m_vAngularVelocity;
8 EntityID m_TreeID;
9
10 //################################################################################################
12 //------------------------------------------------------------------------------------------------
13 static void Encode(SSnapSerializerBase snapshot, ScriptCtx ctx, ScriptBitSerializer packet)
14 {
15 snapshot.Serialize(packet, 64);
16 }
17
18 //------------------------------------------------------------------------------------------------
19 static bool Decode(ScriptBitSerializer packet, ScriptCtx ctx, SSnapSerializerBase snapshot)
20 {
21 return snapshot.Serialize(packet, 64);
22 }
23
24 //------------------------------------------------------------------------------------------------
25 static bool SnapCompare(SSnapSerializerBase lhs, SSnapSerializerBase rhs, ScriptCtx ctx)
26 {
27 return lhs.CompareSnapshots(rhs, 64);
28 }
29
30 //------------------------------------------------------------------------------------------------
31 static bool PropCompare(SCR_TreePartSynchronizationData prop, SSnapSerializerBase snapshot, ScriptCtx ctx)
32 {
33 return snapshot.Compare(prop.m_iTreePartIndex, 4)
34 && snapshot.Compare(prop.m_fQuaternion[0], 4)
35 && snapshot.Compare(prop.m_fQuaternion[1], 4)
36 && snapshot.Compare(prop.m_fQuaternion[2], 4)
37 && snapshot.Compare(prop.m_fQuaternion[3], 4)
38 && snapshot.Compare(prop.m_vPosition[0], 4)
39 && snapshot.Compare(prop.m_vPosition[1], 4)
40 && snapshot.Compare(prop.m_vPosition[2], 4)
41 && snapshot.Compare(prop.m_vVelocity[0], 4)
42 && snapshot.Compare(prop.m_vVelocity[1], 4)
43 && snapshot.Compare(prop.m_vVelocity[2], 4)
44 && snapshot.Compare(prop.m_vAngularVelocity[0], 4)
45 && snapshot.Compare(prop.m_vAngularVelocity[1], 4)
46 && snapshot.Compare(prop.m_vAngularVelocity[2], 4)
47 && snapshot.Compare(prop.m_TreeID, 8);
48 }
49
50 //------------------------------------------------------------------------------------------------
51 static bool Extract(SCR_TreePartSynchronizationData prop, ScriptCtx ctx, SSnapSerializerBase snapshot)
52 {
53 snapshot.SerializeBytes(prop.m_iTreePartIndex, 4);
54 snapshot.SerializeBytes(prop.m_fQuaternion[0], 4);
55 snapshot.SerializeBytes(prop.m_fQuaternion[1], 4);
56 snapshot.SerializeBytes(prop.m_fQuaternion[2], 4);
57 snapshot.SerializeBytes(prop.m_fQuaternion[3], 4);
58 snapshot.SerializeBytes(prop.m_vPosition[0], 4);
59 snapshot.SerializeBytes(prop.m_vPosition[1], 4);
60 snapshot.SerializeBytes(prop.m_vPosition[2], 4);
61 snapshot.SerializeBytes(prop.m_vVelocity[0], 4);
62 snapshot.SerializeBytes(prop.m_vVelocity[1], 4);
63 snapshot.SerializeBytes(prop.m_vVelocity[2], 4);
64 snapshot.SerializeBytes(prop.m_vAngularVelocity[0], 4);
65 snapshot.SerializeBytes(prop.m_vAngularVelocity[1], 4);
66 snapshot.SerializeBytes(prop.m_vAngularVelocity[2], 4);
67 snapshot.SerializeBytes(prop.m_TreeID, 8);
68
69 return true;
70 }
71
72 //------------------------------------------------------------------------------------------------
73 static bool Inject(SSnapSerializerBase snapshot, ScriptCtx ctx, SCR_TreePartSynchronizationData prop)
74 {
75 snapshot.SerializeBytes(prop.m_iTreePartIndex, 4);
76 float temp;
77 snapshot.SerializeBytes(temp, 4);
78 prop.m_fQuaternion[0] = temp;
79 snapshot.SerializeBytes(temp, 4);
80 prop.m_fQuaternion[1] = temp;
81 snapshot.SerializeBytes(temp, 4);
82 prop.m_fQuaternion[2] = temp;
83 snapshot.SerializeBytes(temp, 4);
84 prop.m_fQuaternion[3] = temp;
85 snapshot.SerializeBytes(temp, 4);
86 prop.m_vPosition[0] = temp;
87 snapshot.SerializeBytes(temp, 4);
88 prop.m_vPosition[1] = temp;
89 snapshot.SerializeBytes(temp, 4);
90 prop.m_vPosition[2] = temp;
91 snapshot.SerializeBytes(temp, 4);
92 prop.m_vVelocity[0] = temp;
93 snapshot.SerializeBytes(temp, 4);
94 prop.m_vVelocity[1] = temp;
95 snapshot.SerializeBytes(temp, 4);
96 prop.m_vVelocity[2] = temp;
97 snapshot.SerializeBytes(temp, 4);
98 prop.m_vAngularVelocity[0] = temp;
99 snapshot.SerializeBytes(temp, 4);
100 prop.m_vAngularVelocity[1] = temp;
101 snapshot.SerializeBytes(temp, 4);
102 prop.m_vAngularVelocity[2] = temp;
103 snapshot.SerializeBytes(prop.m_TreeID, 8);
104
105 return true;
106 }
107
108 //------------------------------------------------------------------------------------------------
109 void SCR_TreePartSynchronizationData()
110 {
111
112 }
113
114 //------------------------------------------------------------------------------------------------
115 void ~SCR_TreePartSynchronizationData()
116 {
117
118 }
119};