1 /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */
2 
3 #ifndef TEAMSTATISTICS_H
4 #define TEAMSTATISTICS_H
5 
6 #include "System/creg/creg_cond.h"
7 #include "System/Platform/byteorder.h"
8 
9 #include <cstring>
10 
11 #pragma pack(push, 1)
12 
13 struct TeamStatistics
14 {
15 	CR_DECLARE_STRUCT(TeamStatistics)
16 
17 	TeamStatistics();
18 
19 	int frame; /* frame is the start address and must be the first element */
20 
21 	float metalUsed,     energyUsed;
22 	float metalProduced, energyProduced;
23 	float metalExcess,   energyExcess;
24 	float metalReceived, energyReceived; /* received from allies */
25 	float metalSent,     energySent;     /* sent to allies */
26 
27 	float damageDealt,   damageReceived; /* Damage taken and dealt to enemy units */
28 
29 	int unitsProduced;
30 	int unitsDied;
31 	int unitsReceived;
32 	int unitsSent;
33 	/* units captured from enemy by us */
34 	int unitsCaptured;
35 	/* units captured from us by enemy */
36 	int unitsOutCaptured;
37 	/* how many enemy units have been killed by this teams units */
38 	int unitsKilled;
39 
40 	/// Change structure from host endian to little endian or vice versa.
41 	void swab();
42 
43 	/// In intervalls of this many seconds, statistics are updated
44 	static const int statsPeriod = 16;
45 };
46 
47 #pragma pack(pop)
48 
49 #endif
50