]>
Commit | Line | Data |
---|---|---|
e248e6be | 1 | #ifndef TOPLIST_H |
2 | #define TOPLIST_H | |
3 | ||
4 | #include <list> | |
5 | ||
6 | using namespace std; | |
7 | ||
8 | // Forward declaration | |
9 | class Player; | |
10 | ||
11 | class toplist { | |
12 | public: | |
13 | // Default Constructor | |
14 | toplist(); | |
15 | ||
16 | // Constructor with a parameter for the count | |
17 | toplist(int); | |
18 | ||
19 | // Destructor | |
20 | ~toplist(); | |
21 | ||
22 | // Insert the player into the top list if they make it | |
23 | void insertPlayer(Player *); | |
24 | ||
25 | // Set how many players should be in the toplist | |
26 | void setCount(int); | |
27 | int getCount() { return count; }; | |
28 | ||
29 | // Sort the list | |
30 | void sort(); | |
31 | ||
32 | // Prune the list so it's not larger than the count | |
33 | void prune(); | |
34 | ||
abb0a0b9 | 35 | list<Player>::iterator begin();\r |
36 | list<Player>::iterator end(); | |
e248e6be | 37 | |
38 | private: | |
39 | ||
40 | // The actual list of players | |
41 | list<Player> myList; | |
42 | ||
43 | // The number of players to keep in the list | |
44 | int count; | |
45 | }; | |
46 | #endif |