TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ArenaScore.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
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_ARENA_SCORE_H
19 #define TRINITY_ARENA_SCORE_H
20 
21 #include "BattlegroundScore.h"
22 #include "SharedDefines.h"
23 #include "Player.h"
24 #include "ObjectAccessor.h"
25 
27 {
28  friend class Arena;
29 
30  protected:
31  ArenaScore(ObjectGuid playerGuid, uint32 team) : BattlegroundScore(playerGuid, team), TeamId(team == ALLIANCE ? BG_TEAM_ALLIANCE : BG_TEAM_HORDE) { }
32 
33  void BuildObjectivesBlock(std::vector<int32>& /*stats*/) override { }
34 
35  // For Logging purpose
36  std::string ToString() const override
37  {
38  std::ostringstream stream;
39  stream << "Damage done: " << DamageDone << ", Healing done: " << HealingDone << ", Killing blows: " << KillingBlows;
40  return stream.str();
41  }
42 
43  uint8 TeamId; // BattlegroundTeamId
44 };
45 
47 {
48  friend class Arena;
49  friend class Battleground;
50 
51  protected:
52  ArenaTeamScore() : OldRating(0), NewRating(0), MatchmakerRating(0) { }
53 
54  virtual ~ArenaTeamScore() { }
55 
56  void Reset()
57  {
58  OldRating = 0;
59  NewRating = 0;
60  MatchmakerRating = 0;
61  }
62 
63  void Assign(int32 oldRating, int32 newRating, uint32 matchMakerRating)
64  {
65  OldRating = oldRating;
66  NewRating = newRating;
67  MatchmakerRating = matchMakerRating;
68  }
69 
73 };
74 
75 #endif // TRINITY_ARENA_SCORE_H
uint8 TeamId
Definition: ArenaScore.h:43
virtual ~ArenaTeamScore()
Definition: ArenaScore.h:54
uint32 MatchmakerRating
Definition: ArenaScore.h:72
ArenaTeamScore()
Definition: ArenaScore.h:52
void Reset()
Definition: ArenaScore.h:56
Definition: ArenaScore.h:46
void BuildObjectivesBlock(std::vector< int32 > &) override
Definition: ArenaScore.h:33
Definition: SharedDefines.h:1000
Definition: BattlegroundScore.h:54
std::string ToString() const override
Definition: ArenaScore.h:36
uint32 KillingBlows
Definition: BattlegroundScore.h:115
void Assign(int32 oldRating, int32 newRating, uint32 matchMakerRating)
Definition: ArenaScore.h:63
Definition: Arena.h:39
Definition: ArenaScore.h:26
int32_t int32
Definition: Define.h:146
uint32_t uint32
Definition: Define.h:150
ArenaScore(ObjectGuid playerGuid, uint32 team)
Definition: ArenaScore.h:31
TeamId
Definition: SharedDefines.h:990
Definition: SharedDefines.h:4551
int32 NewRating
Definition: ArenaScore.h:71
#define TC_GAME_API
Definition: Define.h:134
uint8_t uint8
Definition: Define.h:152
Definition: Battleground.h:235
Definition: SharedDefines.h:4550
Definition: ObjectGuid.h:189
int32 OldRating
Definition: ArenaScore.h:70