Diffstat (limited to 'noncore/games/tetrix/ohighscoredlg.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/games/tetrix/ohighscoredlg.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/noncore/games/tetrix/ohighscoredlg.h b/noncore/games/tetrix/ohighscoredlg.h index fdbe623..845e639 100644 --- a/noncore/games/tetrix/ohighscoredlg.h +++ b/noncore/games/tetrix/ohighscoredlg.h | |||
@@ -1,81 +1,80 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * This program is free software; you can redistribute it and/or modify * | 3 | * This program is free software; you can redistribute it and/or modify * |
4 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * ( at your option ) any later version. * | 6 | * ( at your option ) any later version. * |
7 | * * | 7 | * * |
8 | **************************************************************************/ | 8 | **************************************************************************/ |
9 | 9 | ||
10 | class QWidget; | 10 | class QWidget; |
11 | class QVBoxLayout; | 11 | class QVBoxLayout; |
12 | class QListView; | 12 | class QListView; |
13 | 13 | ||
14 | #include <qdialog.h> | 14 | #include <qdialog.h> |
15 | #include <list> | 15 | #include <qlist.h> |
16 | 16 | ||
17 | using namespace std; | 17 | class t_playerData |
18 | |||
19 | struct t_playerData | ||
20 | { | 18 | { |
19 | |||
20 | public : | ||
21 | |||
21 | QString sName; | 22 | QString sName; |
22 | int points; | 23 | int points; |
23 | int level; | 24 | int level; |
24 | }; | 25 | }; |
25 | 26 | ||
26 | class OHighscore : public QWidget | 27 | class OHighscore : public QWidget |
27 | { | 28 | { |
28 | Q_OBJECT | 29 | Q_OBJECT |
29 | 30 | ||
30 | public: | 31 | public: |
31 | /* | 32 | /* |
32 | *An OHighscore-Object contains all Points, level and playernames sorted in a stl::vector | 33 | *An OHighscore-Object contains all Points, level and playernames sorted in a stl::vector |
33 | */ | 34 | */ |
34 | OHighscore( int , int ); | 35 | OHighscore( int , int ); |
35 | 36 | ||
36 | ~OHighscore(); | 37 | ~OHighscore(); |
37 | 38 | ||
38 | /* | 39 | /* |
39 | * is true if the player did a new highscore | 40 | * is true if the player did a new highscore |
40 | */ | 41 | */ |
41 | bool isNewhighscore; | 42 | bool isNewhighscore; |
42 | 43 | ||
43 | /* | 44 | /* |
44 | * this inserts the new entry at the correct position | 45 | * this inserts the new entry at the correct position |
45 | */ | 46 | */ |
46 | void insertData( QString , int , int ); | 47 | void insertData( QString , int , int ); |
47 | 48 | ||
48 | list<t_playerData*> playerData; | 49 | QList<t_playerData> playerData; |
49 | 50 | ||
50 | /* | 51 | /* |
51 | * As Qt/e does not support QInputDialog I did that code myself | 52 | * As Qt/e does not support QInputDialog I did that code myself |
52 | */ | 53 | */ |
53 | QString getName(); | 54 | QString getName(); |
54 | private: | 55 | private: |
55 | 56 | ||
56 | list<t_playerData*>::iterator iPlayerData; | ||
57 | |||
58 | /* | 57 | /* |
59 | * the lowest score in the highscorelist | 58 | * the lowest score in the highscorelist |
60 | */ | 59 | */ |
61 | int lowest; | 60 | int lowest; |
62 | 61 | ||
63 | /* | 62 | /* |
64 | * the level of the highscore | 63 | * the level of the highscore |
65 | */ | 64 | */ |
66 | int pLevel; | 65 | int pLevel; |
67 | 66 | ||
68 | /* | 67 | /* |
69 | * get all scores in a vector and give "lowest" a value | 68 | * get all scores in a vector and give "lowest" a value |
70 | */ | 69 | */ |
71 | void getList(); | 70 | void getList(); |
72 | 71 | ||
73 | /* | 72 | /* |
74 | * sets the bool if the current score is in the top10 | 73 | * sets the bool if the current score is in the top10 |
75 | */ | 74 | */ |
76 | void checkIfItIsANewhighscore( int ); | 75 | void checkIfItIsANewhighscore( int ); |
77 | }; | 76 | }; |
78 | 77 | ||
79 | class OHighscoreDialog : public QDialog | 78 | class OHighscoreDialog : public QDialog |
80 | { | 79 | { |
81 | Q_OBJECT | 80 | Q_OBJECT |