TrinityCore
BattlegroundScore.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef TRINITY_BATTLEGROUND_SCORE_H
19#define TRINITY_BATTLEGROUND_SCORE_H
20
21#include "BattlegroundPackets.h"
22#include "ObjectGuid.h"
23#include <map>
24#include <string>
25
26struct BattlegroundPlayerScoreTemplate;
27
29{
30 // ALL
37};
38
40{
41 BattlegroundScore(ObjectGuid playerGuid, uint32 team, std::unordered_set<uint32> const* pvpStatIds);
43
44 void UpdateScore(uint32 type, uint32 value);
45 void UpdatePvpStat(uint32 pvpStatID, uint32 value);
46
47 // For Logging purpose
48 std::string ToString() const;
49
51 uint32 GetDeaths() const { return Deaths; }
53 uint32 GetBonusHonor() const { return BonusHonor; }
54 uint32 GetDamageDone() const { return DamageDone; }
55 uint32 GetHealingDone() const { return HealingDone; }
56
57 uint32 GetAttr(uint8 index) const;
58
60
61protected:
62
64 uint8 TeamId; // PvPTeamId
65
66 // Default score, present in every type
73
78
79 std::map<uint32 /*pvpStatID*/, uint32 /*value*/> PvpStats;
80
81private:
82 std::unordered_set<uint32> const* _validPvpStatIds;
83};
84
85#endif // TRINITY_BATTLEGROUND_SCORE_H
ScoreType
@ SCORE_KILLING_BLOWS
@ SCORE_BONUS_HONOR
@ SCORE_DEATHS
@ SCORE_DAMAGE_DONE
@ SCORE_HEALING_DONE
@ SCORE_HONORABLE_KILLS
uint8_t uint8
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:142
virtual ~BattlegroundScore()
BattlegroundScore(ObjectGuid playerGuid, uint32 team, std::unordered_set< uint32 > const *pvpStatIds)
void BuildPvPLogPlayerDataPacket(WorldPackets::Battleground::PVPMatchStatistics::PVPMatchPlayerStatistics &playerData) const
void UpdateScore(uint32 type, uint32 value)
std::string ToString() const
std::unordered_set< uint32 > const * _validPvpStatIds
uint32 GetBonusHonor() const
uint32 GetDamageDone() const
uint32 GetHonorableKills() const
void UpdatePvpStat(uint32 pvpStatID, uint32 value)
uint32 GetDeaths() const
uint32 GetHealingDone() const
std::map< uint32, uint32 > PvpStats
uint32 GetKillingBlows() const
uint32 GetAttr(uint8 index) const