Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_PlayerFactionInfo.c
Go to the documentation of this file.
2 {
3  protected int m_iPlayerId;
4  protected int m_iFactionIndex = -1;
5 
6  //------------------------------------------------------------------------------------------------
8  int GetFactionIndex()
9  {
10  return m_iFactionIndex;
11  }
12 
13  //------------------------------------------------------------------------------------------------
15  void SetFactionIndex(int factionIndex)
16  {
17  m_iFactionIndex = factionIndex;
18  }
19 
20  //------------------------------------------------------------------------------------------------
22  int GetPlayerId()
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  //------------------------------------------------------------------------------------------------
103  static bool SnapCompare(SSnapSerializerBase lhs, SSnapSerializerBase rhs , ScriptCtx ctx)
104  {
105  return lhs.CompareSnapshots(rhs, 4 + 4); // m_iPlayerId, m_iFactionIndex
106  }
107 
108  //------------------------------------------------------------------------------------------------
114  static bool PropCompare(SCR_PlayerFactionInfo instance, SSnapSerializerBase snapshot, ScriptCtx ctx)
115  {
116  return snapshot.CompareInt(instance.m_iPlayerId)
117  && snapshot.CompareInt(instance.m_iFactionIndex);
118  }
119 }
SCR_PlayerFactionInfo
Definition: SCR_PlayerFactionInfo.c:1
m_iPlayerId
protected int m_iPlayerId
Definition: SCR_CallsignCharacterComponent.c:14
m_iFactionIndex
protected int m_iFactionIndex
Definition: SCR_EditableFactionComponent.c:21