Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_PlayerLoadoutInfo.c
Go to the documentation of this file.
2{
3 protected int m_iPlayerId;
4 protected int m_iLoadoutIndex = -1;
5
6 //------------------------------------------------------------------------------------------------
9 {
10 return m_iLoadoutIndex;
11 }
12
13 //------------------------------------------------------------------------------------------------
15 void SetLoadoutIndex(int loadoutIndex)
16 {
17 m_iLoadoutIndex = loadoutIndex;
18 }
19
20 //------------------------------------------------------------------------------------------------
23 {
24 return m_iPlayerId;
25 }
26
27 //------------------------------------------------------------------------------------------------
31 static SCR_PlayerLoadoutInfo Create(int playerId)
32 {
34 info.m_iPlayerId = playerId;
35 info.m_iLoadoutIndex = -1;
36 return info;
37 }
38
39 //################################################################################################
41 //------------------------------------------------------------------------------------------------
47 static bool Extract(SCR_PlayerLoadoutInfo instance, ScriptCtx ctx, SSnapSerializerBase snapshot)
48 {
49 snapshot.SerializeInt(instance.m_iPlayerId);
50 snapshot.SerializeInt(instance.m_iLoadoutIndex);
51 return true;
52 }
53
54 //------------------------------------------------------------------------------------------------
60 static bool Inject(SSnapSerializerBase snapshot, ScriptCtx ctx, SCR_PlayerLoadoutInfo instance)
61 {
62 snapshot.SerializeInt(instance.m_iPlayerId);
63 snapshot.SerializeInt(instance.m_iLoadoutIndex);
64 return true;
65 }
66
67 //------------------------------------------------------------------------------------------------
72 static void Encode(SSnapSerializerBase snapshot, ScriptCtx ctx, ScriptBitSerializer packet)
73 {
74 snapshot.EncodeInt(packet); // m_iPlayerId
75 snapshot.EncodeInt(packet); // m_iLoadoutIndex
76 }
77
78 //------------------------------------------------------------------------------------------------
84 static bool Decode(ScriptBitSerializer packet, ScriptCtx ctx, SSnapSerializerBase snapshot)
85 {
86 snapshot.DecodeInt(packet); // m_iPlayerId
87 snapshot.DecodeInt(packet); // m_iLoadoutIndex
88 return true;
89 }
90
91 //------------------------------------------------------------------------------------------------
98 {
99 return lhs.CompareSnapshots(rhs, 4+4); // m_iPlayerId, m_iLoadoutIndex
100 }
101
102 //------------------------------------------------------------------------------------------------
109 {
110 return snapshot.CompareInt(instance.m_iPlayerId)
111 && snapshot.CompareInt(instance.m_iLoadoutIndex);
112 }
113};
static bool PropCompare(SCR_PlayerLoadoutInfo instance, SSnapSerializerBase snapshot, ScriptCtx ctx)
static SCR_PlayerLoadoutInfo Create(int playerId)
void SetLoadoutIndex(int loadoutIndex)
static bool Extract(SCR_PlayerLoadoutInfo instance, ScriptCtx ctx, SSnapSerializerBase snapshot)
Codec methods.
static bool Decode(ScriptBitSerializer packet, ScriptCtx ctx, SSnapSerializerBase snapshot)
static bool Inject(SSnapSerializerBase snapshot, ScriptCtx ctx, SCR_PlayerLoadoutInfo instance)
static void Encode(SSnapSerializerBase snapshot, ScriptCtx ctx, ScriptBitSerializer packet)
static bool SnapCompare(SSnapSerializerBase lhs, SSnapSerializerBase rhs, ScriptCtx ctx)