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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
#ifndef MENU_H
#define MENU_H
#include <vector>
#include <string>
#include "../umath/vec2.h"
#include "tech.h"
class Option {
public:
Option(std::string name, int id) : name(name), id(id) {}
std::string name;
int id;
std::vector<float> cost;
};
class Menu {
public:
bool active { false };
std::vector<Option> options;
vec2 pos, size;
int over;
void close ();
virtual void open (vec2 res);
virtual int mouse_option (vec2 mouse);
};
class Menu_unit : public Menu {
public:
Menu_unit () {}
enum Opts {
move, attack, done, build, train, trade, age_up, heal, convert
};
};
class Menu_day : public Menu {
public:
Menu_day () {}
enum Opts {
end_day, tech, empire_review, scoring
};
};
class Menu_build : public Menu {
public:
Menu_build () {}
};
class Menu_train : public Menu {
public:
Menu_train () {}
};
class Menu_trade : public Menu {
public:
Menu_trade () {}
enum Opts {
food, gold
};
};
class Menu_age_up : public Menu {
public:
Menu_age_up () {}
};
class OptionTech {
public:
OptionTech(std::string name, Tech *tech) : name(name), tech(tech) {}
std::string name;
Tech *tech;
};
class Menu_tech : public Menu {
public:
Menu_tech () {}
std::vector<OptionTech> tech_options;
std::vector<std::vector<OptionTech>> tech_opt_ordered;
void open (vec2 res) override;
int mouse_option (vec2 mouse) override;
};
#endif
|