summary refs log tree commit diff stats
path: root/src/menu.h
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2022-03-19 16:46:19 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2022-03-19 16:46:19 -0400
commitb2f0190f6b2a227a21dd4909476171f7cc371a2d (patch)
tree0b12cdc515198a6daf5d0a39ed40f581e410cfba /src/menu.h
parent81e8c1dae2e7e4be632d6e81d765b5dd43ea3927 (diff)
downloadether-b2f0190f6b2a227a21dd4909476171f7cc371a2d.tar.gz
ether-b2f0190f6b2a227a21dd4909476171f7cc371a2d.tar.bz2
ether-b2f0190f6b2a227a21dd4909476171f7cc371a2d.zip
menu!
Diffstat (limited to 'src/menu.h')
-rw-r--r--src/menu.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/menu.h b/src/menu.h new file mode 100644 index 0000000..ac72999 --- /dev/null +++ b/src/menu.h
@@ -0,0 +1,42 @@
1#ifndef MENU_H_61DBBF6A
2#define MENU_H_61DBBF6A
3
4#include <string>
5#include <functional>
6#include <vector>
7#include "interpolation.h"
8
9class Game;
10
11enum class MenuState {
12 Closed,
13 Opening,
14 Open,
15 Closing
16};
17
18struct MenuItem {
19 std::string text;
20 std::function<void(Game&)> activationFunction;
21};
22
23class Menu {
24public:
25
26 Menu();
27
28 void update(size_t dt, Game& game);
29
30 void open(Game& game);
31
32 MenuState menuState = MenuState::Closed;
33 Interpolation menuDisplayProgress;
34 std::vector<MenuItem> items;
35 int cursor = 0;
36
37private:
38
39 void close();
40};
41
42#endif /* end of include guard: MENU_H_61DBBF6A */