12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #ifndef FACE_H
- #define FACE_H
- #include <iostream>
- #include <functional>
- class Face final {
- 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
|