summary refs log tree commit diff stats
path: root/src/menu.h
blob: ac729994c873c091fe4b55808b6c55ea419271f2 (plain) (blame)
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
#ifndef MENU_H_61DBBF6A
#define MENU_H_61DBBF6A

#include <string>
#include <functional>
#include <vector>
#include "interpolation.h"

class Game;

enum class MenuState {
  Closed,
  Opening,
  Open,
  Closing
};

struct MenuItem {
  std::string text;
  std::function<void(Game&)> activationFunction;
};

class Menu {
public:

  Menu();

  void update(size_t dt, Game& game);

  void open(Game& game);

  MenuState menuState = MenuState::Closed;
  Interpolation menuDisplayProgress;
  std::vector<MenuItem> items;
  int cursor = 0;

private:

  void close();
};

#endif /* end of include guard: MENU_H_61DBBF6A */