|
@@ -1,62 +0,0 @@
|
|
|
-#include "common/utils/Face.h"
|
|
|
-
|
|
|
-Face Face::FACES[6] = {
|
|
|
- {0, 0, 1, 0, "Up"},
|
|
|
- {1, 1, 0, 0, "North"},
|
|
|
- {2, 0, 0, 1, "East"},
|
|
|
- {3, 0, -1, 0, "Down"},
|
|
|
- {4, -1, 0, 0, "South"},
|
|
|
- {5, 0, 0, -1, "West"}
|
|
|
-};
|
|
|
-
|
|
|
-const Face& Face::UP = FACES[0];
|
|
|
-const Face& Face::DOWN = FACES[3];
|
|
|
-
|
|
|
-const Face& Face::NORTH = FACES[1];
|
|
|
-const Face& Face::SOUTH = FACES[4];
|
|
|
-
|
|
|
-const Face& Face::EAST = FACES[2];
|
|
|
-const Face& Face::WEST = FACES[5];
|
|
|
-
|
|
|
-Face::Face(int index, int offsetX, int offsetY, int offsetZ, const char* name) :
|
|
|
-index(index), offsetX(offsetX), offsetY(offsetY), offsetZ(offsetZ), name(name) {
|
|
|
-}
|
|
|
-
|
|
|
-int Face::getX() const {
|
|
|
- return offsetX;
|
|
|
-}
|
|
|
-
|
|
|
-int Face::getY() const {
|
|
|
- return offsetY;
|
|
|
-}
|
|
|
-
|
|
|
-int Face::getZ() const {
|
|
|
- return offsetZ;
|
|
|
-}
|
|
|
-
|
|
|
-Face& Face::getOpposite() const {
|
|
|
- return FACES[(index + 3) % 6];
|
|
|
-}
|
|
|
-
|
|
|
-const char* Face::getName() const {
|
|
|
- return name;
|
|
|
-}
|
|
|
-
|
|
|
-void Face::forEach(const std::function<void(Face&)>& f) {
|
|
|
- for(int i = 0; i < 6; i++) {
|
|
|
- f(FACES[i]);
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-bool operator==(const Face& l, const Face& r) {
|
|
|
- return &l == &r;
|
|
|
-}
|
|
|
-
|
|
|
-bool operator!=(const Face& l, const Face& r) {
|
|
|
- return &l != &r;
|
|
|
-}
|
|
|
-
|
|
|
-std::ostream& operator<<(std::ostream& os, const Face& f) {
|
|
|
- os << f.getName();
|
|
|
- return os;
|
|
|
-}
|