-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathScene.h
67 lines (55 loc) · 2 KB
/
Scene.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
#include <algorithm>
#include <vector>
#include <string>
#include "libs/CImg.h"
using namespace std;
using namespace cimg_library;
enum Action { Draw, Write, NoAction };
enum Shape { Circle, Square, NoShape };
enum Scene_Size { Big, Medium, Small };
enum X_Position { Left, X_Center, Right };
enum Y_Position { Top, Y_Center, Bottom };
enum Color { Black, Blue, Brown, Green, Red, Orange, Purple, Yellow, White };
class Element {
public:
Element(Action action, string size, string color, string x, string y, Shape shape);
Element(Action action, string size, string color, string x, string y, string text);
Element(Action action);
Action getAction();
Color getColor();
X_Position getX();
Y_Position getY();
Scene_Size getSize();
string getText();
Shape getShape();
static Shape convertShape(string shape);
private:
Action _action;
Color _color;
X_Position _x_position;
Y_Position _y_position;
Scene_Size _size;
string _text;
Shape _shape;
Color convertColor(string color);
Scene_Size convertSize(string size);
void setPosition(string x, string y);
};
class Scene {
public:
Scene(string name, vector<Element> elements);
void draw();
private:
string _name;
vector<Element> _elements;
static const int FONT_BIG = 53;
static const int FONT_MEDIUM = 23;
static const int FONT_SMALL = 13;
int getSize(int sizeImg, Scene_Size size);
int getSizeFont(Scene_Size size);
int getX(int sizeImg, Scene_Size size, X_Position x, int length);
int getY(int sizeImg, Scene_Size size, Y_Position y);
int getPosition(int sizeImg, int sizeElement, X_Position x);
int getPosition(int sizeImg, int sizeElement, Y_Position y);
unsigned char* getColor(Color color);
};