Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_PlayerScoreInfoFiringRange.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
4 {
5  int m_iID = -1;
6  int m_iScore = 0;
7  int m_iScoreMax = 0;
8 
9  //################################################################################################
11  //------------------------------------------------------------------------------------------------
12  static void Encode(SSnapSerializerBase snapshot, ScriptCtx ctx, ScriptBitSerializer packet)
13  {
14  snapshot.Serialize(packet, 12);
15  }
16 
17  //------------------------------------------------------------------------------------------------
18  static bool Decode(ScriptBitSerializer packet, ScriptCtx ctx, SSnapSerializerBase snapshot)
19  {
20  return snapshot.Serialize(packet, 12);
21  }
22 
23  //------------------------------------------------------------------------------------------------
24  static bool SnapCompare(SSnapSerializerBase lhs, SSnapSerializerBase rhs, ScriptCtx ctx)
25  {
26  return lhs.CompareSnapshots(rhs, 12);
27  }
28 
29  //------------------------------------------------------------------------------------------------
30  static bool PropCompare(SCR_PlayerScoreInfoFiringRange prop, SSnapSerializerBase snapshot, ScriptCtx ctx)
31  {
32  return snapshot.Compare(prop.m_iID, 4)
33  && snapshot.Compare(prop.m_iScore, 4)
34  && snapshot.Compare(prop.m_iScoreMax, 4);
35  }
36 
37  //------------------------------------------------------------------------------------------------
38  static bool Extract(SCR_PlayerScoreInfoFiringRange prop, ScriptCtx ctx, SSnapSerializerBase snapshot)
39  {
40  snapshot.SerializeBytes(prop.m_iID, 4);
41  snapshot.SerializeBytes(prop.m_iScore, 4);
42  snapshot.SerializeBytes(prop.m_iScoreMax, 4);
43  return true;
44  }
45 
46  //------------------------------------------------------------------------------------------------
47  static bool Inject(SSnapSerializerBase snapshot, ScriptCtx ctx, SCR_PlayerScoreInfoFiringRange prop)
48  {
49  snapshot.SerializeBytes(prop.m_iID, 4);
50  snapshot.SerializeBytes(prop.m_iScore, 4);
51  snapshot.SerializeBytes(prop.m_iScoreMax, 4);
52 
53  return true;
54  }
55 
56  //################################################################################################
57  //------------------------------------------------------------------------------------------------
59  string GetName()
60  {
61  return GetGame().GetPlayerManager().GetPlayerName(m_iID);
62  }
63 
64  //------------------------------------------------------------------------------------------------
66  void Clear()
67  {
68  m_iScore = 0;
69  m_iScoreMax = 0;
70  }
71 
72  //------------------------------------------------------------------------------------------------
75  void Insert(SCR_PlayerScoreInfoFiringRange playerScoreInfoFiringRange)
76  {
77  m_iScore = playerScoreInfoFiringRange.m_iScore;
78  }
79 
80  //------------------------------------------------------------------------------------------------
82  int GetScore(SCR_FiringRangeScoringComponent scoringSystemFiringRange)
83  {
84  if (!scoringSystemFiringRange)
85  return 0;
86 
87  return m_iScore;
88  }
89 
90  //------------------------------------------------------------------------------------------------
92  int GetScoreMax()
93  {
94  return m_iScoreMax;
95  }
96 
97  //------------------------------------------------------------------------------------------------
98  int GetScore()
99  {
100  return m_iScore;
101  }
102 
103  //------------------------------------------------------------------------------------------------
104  int GetPlayerID()
105  {
106  return m_iID;
107  }
108 };
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
m_iID
protected int m_iID
Definition: SCR_AmbientPatrolSpawnPointComponent.c:42
SCR_PlayerScoreInfoFiringRange
Holds scoring data of players.
Definition: SCR_PlayerScoreInfoFiringRange.c:3
SCR_FiringRangeScoringComponent
void SCR_FiringRangeScoringComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_FiringRangeScoringComponent.c:182