-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathElement.h
More file actions
65 lines (56 loc) · 999 Bytes
/
Copy pathElement.h
File metadata and controls
65 lines (56 loc) · 999 Bytes
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
#pragma once
#include <utility>
#include <vector>
#include <map>
class Element
{
public:
enum Color
{
empty = -1,
cyan = 0,
blue = 1,
orange = 2,
yellow = 3,
green = 4,
purple = 5,
red = 6
};
enum Type
{
none = -1,
I,
J,
L,
O,
S,
T,
Z,
U,
X,
D,
Q,
};
enum class Rotation
{
None = -1, Right, Left
};
Element() : type(none), color(empty) {}
Element(Type ttype, Color ccolor);
Type getType() const;
int getRotation();
Color getColor() const;
std::map<int, std::vector<int>> getShape() const
{
return shape;
}
void rotate(Rotation rrotation);
private:
// Type of the element, used to alter shape after rotation
Type type;
// Color fot the element :wink:
Color color;
int rotation;
std::map<int, std::vector<int>> orginalShape;
std::map<int, std::vector<int>> shape;
};