-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMenu.h
70 lines (50 loc) · 1.03 KB
/
Menu.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#pragma once
#include "AudioPlayer.h"
#include <string>
#include "ScoreboardManager.h"
class Exit;
class Difficulty;
class Reset;
class Start;
class Button;
namespace tmpl8
{
class Surface;
class Sprite;
}
class Menu
{
public:
Menu();
~Menu();
void Render(tmpl8::Surface& dst) const;
void MouseDown(int button);
void MouseMove(int x, int y) const;
int GetState() const { return state; }
void SetState(int state) { this->state = state; }
Exit* GetExitButton() const { return buttons.exit; }
void ButtonDown(Uint8 button);
void KeyDown(SDL_Keycode key);
SDL_Cursor* GetArrowCursor() const {return arrow;}
private:
tmpl8::Surface* menu;
int state = 0;
union
{
struct
{
Difficulty* normal;
Difficulty* easy;
Difficulty* hard;
Start* start;
Reset* reset;
Exit* exit;
};
Button* array[6];
} buttons;
AudioPlayer click{ "assets/sounds/button.wav" };
ScoreboardManager scoreboard;
std::string input;
SDL_Cursor* arrow;
SDL_Cursor* hand;
};