From a59fcafb2e81f3cb40ff320b106030e8fed4bd66 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 2 Nov 2023 18:38:53 -0400 Subject: Modernized C++ a bit (and removed global highscores) --- hs_state.h | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 hs_state.h (limited to 'hs_state.h') diff --git a/hs_state.h b/hs_state.h new file mode 100644 index 0000000..64ecac0 --- /dev/null +++ b/hs_state.h @@ -0,0 +1,64 @@ +#ifndef HS_STATE_H_C824D037 +#define HS_STATE_H_C824D037 + +#include + +#include "hslist.h" +#include "mazeoflife.h" +#include "sdl.h" +#include "state.h" + +class DisplayLocalHighscoreListState : public State { + public: + explicit DisplayLocalHighscoreListState(Game& game); + + std::unique_ptr operator()(Game& game); + + private: + texture_ptr list_; + texture_ptr pointer_; +}; + +class DisplayAndReturnLocalHighscoreListState : public State { + public: + explicit DisplayAndReturnLocalHighscoreListState(Game& game); + + std::unique_ptr operator()(Game& game); + + private: + texture_ptr list_; + texture_ptr pointer_; + int selection_ = 0; +}; + +class EnterHighscoreState : public State { + public: + EnterHighscoreState(Game& game, int level); + + std::unique_ptr operator()(Game& game); + + private: + int level_; + int lp_ = 0; + std::string hsname_; + texture_ptr newName_; + texture_ptr pointer_; + texture_ptr list_; + SDL_Rect rntSpace_; + int newpos_; +}; + +class NewHighscoreState : public State { + public: + NewHighscoreState(Game& game, Highscore h); + + std::unique_ptr operator()(Game& game); + + private: + Highscore h_; + texture_ptr pointer_; + texture_ptr list_; + int selection_ = 0; +}; + +#endif /* end of include guard: HS_STATE_H_C824D037 */ -- cgit 1.4.1