1 #ifndef BATTLEFIELD_PLAYERSTATS_H
2 #define BATTLEFIELD_PLAYERSTATS_H
6 #include <battlefield.h>
7 #include <unordered_map>
55 static std::unordered_map<std::string, SetterFunc> SetterMap;
58 int32_t GetScore()
const {
return this->
_score; }
59 uint32_t GetRank()
const {
return this->
_ran; }
60 uint32_t GetPPH()
const {
return this->
_pph; }
61 uint32_t GetKills()
const {
return this->
_kills; }
62 uint32_t GetDeaths()
const {
return this->
_deaths; }
63 uint32_t GetSuicides()
const {
return this->
_suicides; }
64 uint32_t GetTime()
const {
return this->
_time; }
65 uint32_t GetVehiclesDestroyed()
const {
return this->
_vehicles; }
66 uint32_t GetLAVsDestroyed()
const {
return this->
_lavd; }
67 uint32_t GetMAVsDestroyed()
const {
return this->
_mavd; }
68 uint32_t GetHAVsDestroyed()
const {
return this->
_havd; }
69 uint32_t GetHelicoptersDestroyed()
const {
return this->
_hed; }
70 uint32_t GetPlanesDestroyed()
const {
return this->
_pld; }
71 uint32_t GetBoatsDestroyed()
const {
return this->
_bod; }
72 uint32_t GetKillsAssualtKit()
const {
return this->
_k1; }
73 uint32_t GetSpawnsAssualtKit()
const {
return this->
_s1; }
74 uint32_t GetKillsSniperKit()
const {
return this->
_k2; }
75 uint32_t GetSpawnsSniperKit()
const {
return this->
_s2; }
76 uint32_t GetKillsSpecialOpKit()
const {
return this->
_k3; }
77 uint32_t GetSpawnsSpecialOpKit()
const {
return this->
_s3; }
78 uint32_t GetKillsCombatEngineerKit()
const {
return this->
_k4; }
79 uint32_t GetSpawnsCombatEngineerKit()
const {
return this->
_s4; }
80 uint32_t GetKillsSupportKit()
const {
return this->
_k5; }
81 uint32_t GetSpawnsSupportKit()
const {
return this->
_s5; }
82 uint32_t GetTeamKills()
const {
return this->
_tk; }
83 uint32_t GetMedals()
const {
return this->
_medals; }
84 uint32_t GetTotalTopPlayer()
const {
return this->
_ttb; }
85 uint32_t GetTotalVictories()
const {
return this->
_mv; }
86 uint32_t GetTotalGameSessions()
const {
return this->
_ngp; }
87 uint32_t GetCapturedFlags()
const {
return this->
_cflags; }
88 uint32_t GetNeutralizedFlags()
const {
return this->
_nflags; }
89 uint32_t GetSavedFlags()
const {
return this->
_sflags; }
91 double GetRatio()
const;
92 double GetRatioAssualtKit()
const;
93 double GetRatioSniperKit()
const;
94 double GetRatioSpecialOpKit()
const;
95 double GetRatioCombatEngineerKit()
const;
96 double GetRatioSupportKit()
const;
98 bool SetScore(int32_t score);
99 bool SetRank(uint32_t ran);
100 bool SetRank(Ranks ran);
101 bool SetPPH(uint32_t pph);
102 bool SetKills(uint32_t kills);
103 bool SetDeaths(uint32_t kills);
104 bool SetSuicides(uint32_t suicides);
105 bool SetTime(uint32_t time);
106 bool SetVehiclesDestroyed(uint32_t vehicles);
107 bool SetLAVsDestroyed(uint32_t lavd);
108 bool SetMAVsDestroyed(uint32_t mavd);
109 bool SetHAVsDestroyed(uint32_t havd);
110 bool SetHelicoptersDestroyed(uint32_t hed);
111 bool SetBoatsDestroyed(uint32_t bod);
112 bool SetKillsAssualtKit(uint32_t kills);
113 bool SetDeathsAssualtKit(uint32_t deaths);
114 bool SetKillsSniperKit(uint32_t kills);
115 bool SetDeathsSniperKit(uint32_t deaths);
116 bool SetKillsSpecialOpKit(uint32_t kills);
117 bool SetDeathsSpecialOpKit(uint32_t deaths);
118 bool SetKillsCombatEngineerKit(uint32_t kills);
119 bool SetDeathsCombatEngineerKit(uint32_t deaths);
120 bool SetKillsSupportKit(uint32_t kills);
121 bool SetDeathsSupportKit(uint32_t deaths);
122 bool SetMedals(uint32_t medals);
123 bool SetMedals(Medals medals);
124 bool SetTotalTopPlayer(uint32_t total);
125 bool SetTotalVictories(uint32_t total);
126 bool SetTotalGameSessions(uint32_t total);
127 bool SetCapturedFlags(uint32_t cflags);
128 bool SetNeutralizedFlags(uint32_t nflags);
129 bool SetSavedFlags(uint32_t sflags);
Represents a player's statistics in a game.
Contains player status information.
void useExample()
Performs an example operation using the PlayerStats class.
void _calcNewPPH(uint32_t time, int32_t score)
Calculates the pph based on game time, game score and current player stats.
void _calcRank()
Calculates the rank based on score, points per hour (pph), and medals.
void Update(const Battlefield::GameStatPlayer &gsplayer)
Update player stats based on played game.