TrinityCore
Loading...
Searching...
No Matches
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 "Errors.h"
22#include "ObjectGuid.h"
23#include "SharedDefines.h"
24
26{
27struct PVPLogData_Player;
28}
29
30class WorldPacket;
31
60
62{
63 friend class Arena;
64 friend class Battleground;
65
66 protected:
69
70 virtual ~BattlegroundScore() { }
71
72 virtual void UpdateScore(uint32 type, uint32 value)
73 {
74 switch (type)
75 {
76 case SCORE_KILLING_BLOWS: // Killing blows
77 KillingBlows += value;
78 break;
79 case SCORE_DEATHS: // Deaths
80 Deaths += value;
81 break;
82 case SCORE_HONORABLE_KILLS: // Honorable kills
83 HonorableKills += value;
84 break;
85 case SCORE_BONUS_HONOR: // Honor bonus
86 BonusHonor += value;
87 break;
88 case SCORE_DAMAGE_DONE: // Damage Done
89 DamageDone += value;
90 break;
91 case SCORE_HEALING_DONE: // Healing Done
92 HealingDone += value;
93 break;
94 default:
95 ABORT_MSG("Not implemented Battleground score type!");
96 break;
97 }
98 }
99
102
103 // For Logging purpose
104 virtual std::string ToString() const { return ""; }
105
107 uint32 GetDeaths() const { return Deaths; }
109 uint32 GetBonusHonor() const { return BonusHonor; }
110 uint32 GetDamageDone() const { return DamageDone; }
112
113 virtual uint32 GetAttr1() const { return 0; }
114 virtual uint32 GetAttr2() const { return 0; }
115 virtual uint32 GetAttr3() const { return 0; }
116 virtual uint32 GetAttr4() const { return 0; }
117 virtual uint32 GetAttr5() const { return 0; }
118
120
121 // Default score, present in every type
128};
129
130#endif // TRINITY_BATTLEGROUND_SCORE_H
@ SCORE_BASES_ASSAULTED
@ SCORE_GRAVEYARDS_ASSAULTED
@ SCORE_KILLING_BLOWS
@ SCORE_TOWERS_DEFENDED
@ SCORE_BONUS_HONOR
@ SCORE_FLAG_CAPTURES
@ SCORE_DEATHS
@ SCORE_TOWERS_ASSAULTED
@ SCORE_MINES_CAPTURED
@ SCORE_DAMAGE_DONE
@ SCORE_DESTROYED_WALL
@ SCORE_DESTROYED_DEMOLISHER
@ SCORE_BASES_DEFENDED
@ SCORE_HEALING_DONE
@ SCORE_GRAVEYARDS_DEFENDED
@ SCORE_HONORABLE_KILLS
@ SCORE_FLAG_RETURNS
uint32_t uint32
Definition Define.h:133
#define ABORT_MSG
Definition Errors.h:75
Definition Arena.h:48
virtual void UpdateScore(uint32 type, uint32 value)
virtual uint32 GetAttr3() const
uint32 GetBonusHonor() const
virtual uint32 GetAttr5() const
uint32 GetDamageDone() const
virtual void BuildObjectivesBlock(WorldPackets::Battleground::PVPLogData_Player &playerData)=0
BattlegroundScore(ObjectGuid playerGuid)
uint32 GetHonorableKills() const
uint32 GetDeaths() const
virtual uint32 GetAttr1() const
virtual uint32 GetAttr4() const
virtual uint32 GetAttr2() const
virtual std::string ToString() const
virtual void AppendToPacket(WorldPackets::Battleground::PVPLogData_Player &playerData)
uint32 GetHealingDone() const
uint32 GetKillingBlows() const