Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_PlayerFactionInfo.c
Go to the documentation of this file.
2{
3 protected int m_iPlayerId;
4 protected int m_iFactionIndex = -1;
5
6 //------------------------------------------------------------------------------------------------
9 {
10 return m_iFactionIndex;
11 }
12
13 //------------------------------------------------------------------------------------------------
15 void SetFactionIndex(int factionIndex)
16 {
17 m_iFactionIndex = factionIndex;
18 }
19
20 //------------------------------------------------------------------------------------------------
23 {
24 return m_iPlayerId;
25 }
26
27 //------------------------------------------------------------------------------------------------
28 // constructor
29 protected void SCR_PlayerFactionInfo();
30
31 //------------------------------------------------------------------------------------------------
35 static SCR_PlayerFactionInfo Create(int playerId)
36 {
38 info.m_iPlayerId = playerId;
39 info.m_iFactionIndex = -1;
40 return info;
41 }
42
43 //################################################################################################
45 //################################################################################################
46
47 //------------------------------------------------------------------------------------------------
53 static bool Extract(SCR_PlayerFactionInfo instance, ScriptCtx ctx, SSnapSerializerBase snapshot)
54 {
55 snapshot.SerializeInt(instance.m_iPlayerId);
56 snapshot.SerializeInt(instance.m_iFactionIndex);
57 return true;
58 }
59
60 //------------------------------------------------------------------------------------------------
66 static bool Inject(SSnapSerializerBase snapshot, ScriptCtx ctx, SCR_PlayerFactionInfo instance)
67 {
68 snapshot.SerializeInt(instance.m_iPlayerId);
69 snapshot.SerializeInt(instance.m_iFactionIndex);
70 return true;
71 }
72
73 //------------------------------------------------------------------------------------------------
78 static void Encode(SSnapSerializerBase snapshot, ScriptCtx ctx, ScriptBitSerializer packet)
79 {
80 snapshot.EncodeInt(packet); // m_iPlayerId
81 snapshot.EncodeInt(packet); // m_iFactionIndex
82 }
83
84 //------------------------------------------------------------------------------------------------
90 static bool Decode(ScriptBitSerializer packet, ScriptCtx ctx, SSnapSerializerBase snapshot)
91 {
92 snapshot.DecodeInt(packet); // m_iPlayerId
93 snapshot.DecodeInt(packet); // m_iFactionIndex
94 return true;
95 }
96
97 //------------------------------------------------------------------------------------------------
104 {
105 return lhs.CompareSnapshots(rhs, 4 + 4); // m_iPlayerId, m_iFactionIndex
106 }
107
108 //------------------------------------------------------------------------------------------------
115 {
116 return snapshot.CompareInt(instance.m_iPlayerId)
117 && snapshot.CompareInt(instance.m_iFactionIndex);
118 }
119}
static bool Extract(SCR_PlayerFactionInfo instance, ScriptCtx ctx, SSnapSerializerBase snapshot)
Codec methods.
static SCR_PlayerFactionInfo Create(int playerId)
static bool Inject(SSnapSerializerBase snapshot, ScriptCtx ctx, SCR_PlayerFactionInfo instance)
static bool PropCompare(SCR_PlayerFactionInfo instance, SSnapSerializerBase snapshot, ScriptCtx ctx)
static bool SnapCompare(SSnapSerializerBase lhs, SSnapSerializerBase rhs, ScriptCtx ctx)
static bool Decode(ScriptBitSerializer packet, ScriptCtx ctx, SSnapSerializerBase snapshot)
static void Encode(SSnapSerializerBase snapshot, ScriptCtx ctx, ScriptBitSerializer packet)
void SetFactionIndex(int factionIndex)