diff options
Diffstat (limited to 'hslist.h')
| -rw-r--r-- | hslist.h | 38 |
1 files changed, 35 insertions, 3 deletions
| diff --git a/hslist.h b/hslist.h index f043336..c1db137 100644 --- a/hslist.h +++ b/hslist.h | |||
| @@ -6,21 +6,27 @@ | |||
| 6 | #ifndef HSLIST_H | 6 | #ifndef HSLIST_H |
| 7 | #define HSLIST_H | 7 | #define HSLIST_H |
| 8 | 8 | ||
| 9 | typedef std::vector<Highscore*> hslist_t; | ||
| 10 | |||
| 11 | void resetRanks(hslist_t in); | ||
| 12 | |||
| 9 | class HighscoreList | 13 | class HighscoreList |
| 10 | { | 14 | { |
| 11 | public: | 15 | public: |
| 12 | SDL_Surface* render(); | 16 | SDL_Surface* render(); |
| 13 | 17 | ||
| 14 | protected: | 18 | protected: |
| 15 | std::vector<Highscore> getLocalHighscores(); | 19 | hslist_t getLocalHighscores(); |
| 16 | std::vector<Highscore> getGlobalHighscores(); | 20 | hslist_t getGlobalHighscores(); |
| 17 | 21 | ||
| 18 | std::vector<Highscore> hslist; | 22 | hslist_t hslist; |
| 19 | }; | 23 | }; |
| 20 | 24 | ||
| 21 | class LocalHighscoreList : public HighscoreList { | 25 | class LocalHighscoreList : public HighscoreList { |
| 22 | public: | 26 | public: |
| 23 | LocalHighscoreList(); | 27 | LocalHighscoreList(); |
| 28 | int addHighscore(Highscore* h); | ||
| 29 | void writeHighscores(); | ||
| 24 | }; | 30 | }; |
| 25 | 31 | ||
| 26 | class GlobalHighscoreList : public HighscoreList { | 32 | class GlobalHighscoreList : public HighscoreList { |
| @@ -45,6 +51,11 @@ class DisplayLocalHighscoreListState : public State { | |||
| 45 | State* operator() (SDL_Renderer* renderer); | 51 | State* operator() (SDL_Renderer* renderer); |
| 46 | }; | 52 | }; |
| 47 | 53 | ||
| 54 | class DisplayAndReturnLocalHighscoreListState : public State { | ||
| 55 | public: | ||
| 56 | State* operator() (SDL_Renderer* renderer); | ||
| 57 | }; | ||
| 58 | |||
| 48 | class DisplayGlobalHighscoreListState : public State { | 59 | class DisplayGlobalHighscoreListState : public State { |
| 49 | public: | 60 | public: |
| 50 | State* operator() (SDL_Renderer* renderer); | 61 | State* operator() (SDL_Renderer* renderer); |
| @@ -59,4 +70,25 @@ class DisplayGlobalHighscoreListState : public State { | |||
| 59 | static int LoadHighscoreList(void* pParam); | 70 | static int LoadHighscoreList(void* pParam); |
| 60 | }; | 71 | }; |
| 61 | 72 | ||
| 73 | class EnterHighscoreState : public State { | ||
| 74 | public: | ||
| 75 | EnterHighscoreState(int level); | ||
| 76 | State* operator() (SDL_Renderer* renderer); | ||
| 77 | |||
| 78 | private: | ||
| 79 | int level; | ||
| 80 | int lp; | ||
| 81 | char* hsname; | ||
| 82 | SDL_Texture* newName; | ||
| 83 | }; | ||
| 84 | |||
| 85 | class NewHighscoreState : public State { | ||
| 86 | public: | ||
| 87 | NewHighscoreState(Highscore* h); | ||
| 88 | State* operator() (SDL_Renderer* renderer); | ||
| 89 | |||
| 90 | private: | ||
| 91 | Highscore* h; | ||
| 92 | }; | ||
| 93 | |||
| 62 | #endif | 94 | #endif |
