-
Notifications
You must be signed in to change notification settings - Fork 1
/
menu.h
39 lines (36 loc) · 854 Bytes
/
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
#include <vector>
#include <string>
#include "frame.h"
#include "ioManager.h"
#include "vector2f.h"
#include "viewport.h"
class Menu {
public:
Menu();
~Menu();
void drawBG() const;
void draw() const;
void lightOn() { click = 1; }
void lightOff() { click = 0; }
void increment() { nextIcon = (nextIcon + 1) % words.size(); }
void decrement() {
nextIcon = (nextIcon + words.size()-1) % words.size();
}
const string& getIconClicked() const;
private:
const IOManager& io;
std::vector<std::string> words;
Vector2f position;
Vector2f space;
ParseXML parser;
SDL_Surface* surfaceOff;
SDL_Surface* surfaceOn;
SDL_Surface * const backSurface;
Frame * const background;
Viewport& viewport;
std::vector<Frame> clicks;
unsigned nextIcon;
unsigned click;
Menu(const Menu&);
Menu& operator=(const Menu&);
};