ManaPlus
killstats.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2009 The Mana World Development Team
4  * Copyright (C) 2011-2019 The ManaPlus Developers
5  * Copyright (C) 2009-2021 Andrei Karas
6  *
7  * This file is part of The ManaPlus Client.
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef GUI_WINDOWS_KILLSTATS_H
24 #define GUI_WINDOWS_KILLSTATS_H
25 
28 
29 #include "gui/widgets/window.h"
30 
31 class Label;
32 class Button;
33 
34 class KillStats final : public Window,
35  public ActionListener,
36  public AttributeListener
37 {
38  public:
42  KillStats();
43 
45 
46 
49  void action(const ActionEvent &event) override final;
50 
51  void gainXp(int64_t Xp);
52 
56  void recalcStats();
57 
61  void update();
62 
63  void resetTimes();
64 
65  void attributeChanged(const AttributesT id,
66  const int64_t oldVal,
67  const int64_t newVal) override final;
68 
69  private:
70  time_t mKillTimer;
80 
87 
89 
91  int64_t mExpCounter;
93  int64_t mExpTCounter;
95  time_t m1minExpTime;
96  int64_t m1minExpNum;
98 
99  time_t m5minExpTime;
100  int64_t m5minExpNum;
102 
104  int64_t m15minExpNum;
106 };
107 
108 extern KillStats *killStats;
109 
110 #endif // GUI_WINDOWS_KILLSTATS_H
Attributes ::T AttributesT
Definition: attributes.h:118
Definition: button.h:102
Label * mLine2
Definition: killstats.h:74
Label * mLine1
Definition: killstats.h:73
Label * mExpTime15Label
Definition: killstats.h:86
void resetTimes()
Definition: killstats.cpp:201
void update()
Definition: killstats.cpp:365
time_t mKillTimer
Definition: killstats.h:70
int m5minSpeed
Definition: killstats.h:101
void gainXp(int64_t Xp)
Definition: killstats.cpp:214
Label * mLine6
Definition: killstats.h:78
int64_t mExpCounter
Definition: killstats.h:91
Label * mExpTime5Label
Definition: killstats.h:84
Button * mResetButton
Definition: killstats.h:71
void attributeChanged(const AttributesT id, const int64_t oldVal, const int64_t newVal)
Definition: killstats.cpp:437
int mKillTCounter
Definition: killstats.h:92
int64_t m5minExpNum
Definition: killstats.h:100
int m1minSpeed
Definition: killstats.h:97
time_t m15minExpTime
Definition: killstats.h:103
time_t m5minExpTime
Definition: killstats.h:99
Label * mLastKillExpLabel
Definition: killstats.h:88
time_t m1minExpTime
Definition: killstats.h:95
Button * mTimerButton
Definition: killstats.h:72
Label * mExpSpeed15Label
Definition: killstats.h:85
void action(const ActionEvent &event)
Definition: killstats.cpp:166
Label * mLine4
Definition: killstats.h:76
Label * mLine3
Definition: killstats.h:75
int64_t mExpTCounter
Definition: killstats.h:93
void recalcStats()
Definition: killstats.cpp:311
Label * mExpSpeed5Label
Definition: killstats.h:83
Label * mLine7
Definition: killstats.h:79
Label * mLine5
Definition: killstats.h:77
int64_t m15minExpNum
Definition: killstats.h:104
int64_t m1minExpNum
Definition: killstats.h:96
Label * mExpTime1Label
Definition: killstats.h:82
int mKillCounter
Definition: killstats.h:90
Label * mExpSpeed1Label
Definition: killstats.h:81
int m15minSpeed
Definition: killstats.h:105
Definition: label.h:91
Definition: window.h:102
KillStats * killStats
Definition: killstats.cpp:45
#define A_NONNULLPOINTER
Definition: localconsts.h:266
#define final
Definition: localconsts.h:46
#define A_DELETE_COPY(func)
Definition: localconsts.h:53