1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #ifndef FACE_H
- #define FACE_H
- #include <iostream>
- #include <functional>
- class Face
- {
- public:
- // force usage by reference in every situation
- Face(const Face& other) = delete;
- Face& operator=(const Face& other) = delete;
- Face(Face&& other) = delete;
- Face& operator=(Face&& other) = delete;
-
- int getX() const;
- int getY() const;
- int getZ() const;
- Face& getOpposite() const;
- const char* getName() const;
- static void forEach(const std::function<void(Face&)>& f);
-
- static const Face& UP;
- static const Face& DOWN;
- static const Face& NORTH;
- static const Face& SOUTH;
- static const Face& EAST;
- static const Face& WEST;
- private:
- Face(int index, int offsetX, int offsetY, int offsetZ, const char* name);
-
- static Face FACES[6];
-
- int index;
-
- int offsetX;
- int offsetY;
- int offsetZ;
-
- const char* name;
- };
- bool operator==(const Face& l, const Face& r);
- bool operator!=(const Face& l, const Face& r);
- std::ostream& operator<<(std::ostream& os, const Face& f);
- #endif
|