TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
BattlegroundTP.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 __BATTLEGROUNDTP_H
19 #define __BATTLEGROUNDTP_H
20 
21 #include "Battleground.h"
22 #include "BattlegroundScore.h"
23 
25 {
26  protected:
27  BattlegroundTPScore(ObjectGuid playerGuid, uint32 team) : BattlegroundScore(playerGuid, team), FlagCaptures(0), FlagReturns(0) { }
28 
29  void UpdateScore(uint32 type, uint32 value) override
30  {
31  switch (type)
32  {
35  break;
36  case SCORE_FLAG_RETURNS:
37  FlagReturns += value;
38  break;
39  default:
40  BattlegroundScore::UpdateScore(type, value);
41  break;
42  }
43  }
44 
45  void BuildObjectivesBlock(std::vector<int32>& stats) override
46  {
47  stats.push_back(FlagCaptures);
48  stats.push_back(FlagReturns);
49  }
50 
51  uint32 GetAttr1() const final override { return FlagCaptures; }
52  uint32 GetAttr2() const final override { return FlagReturns; }
53 
56 };
57 
59 {
60  public:
63 };
64 
65 #endif
BattlegroundTPScore(ObjectGuid playerGuid, uint32 team)
Definition: BattlegroundTP.h:27
Definition: BattlegroundScore.h:35
uint32 GetAttr2() const finaloverride
Definition: BattlegroundTP.h:52
uint32 GetAttr1() const finaloverride
Definition: BattlegroundTP.h:51
virtual void UpdateScore(uint32 type, uint32 value)
Definition: BattlegroundScore.h:65
BattlegroundTP()
Definition: BattlegroundTP.cpp:20
Definition: BattlegroundTP.h:24
Definition: BattlegroundScore.h:54
Definition: BattlegroundScore.h:36
~BattlegroundTP()
Definition: BattlegroundTP.cpp:24
void BuildObjectivesBlock(std::vector< int32 > &stats) override
Definition: BattlegroundTP.h:45
void UpdateScore(uint32 type, uint32 value) override
Definition: BattlegroundTP.h:29
uint32_t uint32
Definition: Define.h:150
uint32 FlagCaptures
Definition: BattlegroundTP.h:54
Definition: BattlegroundTP.h:58
Definition: Battleground.h:235
uint32 FlagReturns
Definition: BattlegroundTP.h:55
const FieldDescriptor value
Definition: descriptor.h:1522
Definition: ObjectGuid.h:189
#define const
Definition: zconf.h:217