summary refs log tree commit diff stats
path: root/hs_state.h
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-11-02 18:38:53 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-11-02 18:38:53 -0400
commita59fcafb2e81f3cb40ff320b106030e8fed4bd66 (patch)
tree7e7396a9422814365a5f903a53d7391d3e7b22fd /hs_state.h
parent45d6e635c880a7fae8711fba366519dd314d9faf (diff)
downloadmazeoflife-a59fcafb2e81f3cb40ff320b106030e8fed4bd66.tar.gz
mazeoflife-a59fcafb2e81f3cb40ff320b106030e8fed4bd66.tar.bz2
mazeoflife-a59fcafb2e81f3cb40ff320b106030e8fed4bd66.zip
Modernized C++ a bit (and removed global highscores) HEAD master
Diffstat (limited to 'hs_state.h')
-rw-r--r--hs_state.h64
1 files changed, 64 insertions, 0 deletions
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 @@
1#ifndef HS_STATE_H_C824D037
2#define HS_STATE_H_C824D037
3
4#include <memory>
5
6#include "hslist.h"
7#include "mazeoflife.h"
8#include "sdl.h"
9#include "state.h"
10
11class DisplayLocalHighscoreListState : public State {
12 public:
13 explicit DisplayLocalHighscoreListState(Game& game);
14
15 std::unique_ptr<State> operator()(Game& game);
16
17 private:
18 texture_ptr list_;
19 texture_ptr pointer_;
20};
21
22class DisplayAndReturnLocalHighscoreListState : public State {
23 public:
24 explicit DisplayAndReturnLocalHighscoreListState(Game& game);
25
26 std::unique_ptr<State> operator()(Game& game);
27
28 private:
29 texture_ptr list_;
30 texture_ptr pointer_;
31 int selection_ = 0;
32};
33
34class EnterHighscoreState : public State {
35 public:
36 EnterHighscoreState(Game& game, int level);
37
38 std::unique_ptr<State> operator()(Game& game);
39
40 private:
41 int level_;
42 int lp_ = 0;
43 std::string hsname_;
44 texture_ptr newName_;
45 texture_ptr pointer_;
46 texture_ptr list_;
47 SDL_Rect rntSpace_;
48 int newpos_;
49};
50
51class NewHighscoreState : public State {
52 public:
53 NewHighscoreState(Game& game, Highscore h);
54
55 std::unique_ptr<State> operator()(Game& game);
56
57 private:
58 Highscore h_;
59 texture_ptr pointer_;
60 texture_ptr list_;
61 int selection_ = 0;
62};
63
64#endif /* end of include guard: HS_STATE_H_C824D037 */