-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextractFront.cpp
46 lines (38 loc) · 1.31 KB
/
extractFront.cpp
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
#include "extractFront.h"
#include "cubeface.h"
vector<Color> ExtractFront::extractLeftFace(CubeFace* cubeface, bool clockwise) const {
vector<Color> colors = cubeface->getRight();
if (clockwise)
reverse(colors.begin(), colors.end());
return colors;
}
vector<Color> ExtractFront::extractRightFace(CubeFace* cubeface, bool clockwise) const {
vector<Color> colors = cubeface->getLeft();
if (clockwise)
reverse(colors.begin(), colors.end());
return colors;
}
vector<Color> ExtractFront::extractTopFace(CubeFace* cubeface, bool clockwise) const {
vector<Color> colors = cubeface->getBottom();
if (!clockwise)
reverse(colors.begin(), colors.end());
return colors;
}
vector<Color> ExtractFront::extractBottomFace(CubeFace* cubeface, bool clockwise) const {
vector<Color> colors = cubeface->getTop();
if (!clockwise)
reverse(colors.begin(), colors.end());
return colors;
}
void ExtractFront::setLeftFace(CubeFace* cubeface, vector<Color> colors) const {
cubeface->setRight(colors);
}
void ExtractFront::setRightFace(CubeFace* cubeface, vector<Color> colors) const {
cubeface->setLeft(colors);
}
void ExtractFront::setTopFace(CubeFace* cubeface, vector<Color> colors) const {
cubeface->setBottom(colors);
}
void ExtractFront::setBottomFace(CubeFace* cubeface, vector<Color> colors) const {
cubeface->setTop(colors);
}