12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #ifndef FACE_H
- #define FACE_H
- #include <iostream>
- class Face
- {
- public:
- int getX() const;
- int getY() const;
- int getZ() const;
- Face& getOpposite() const;
- const char* getName() const;
-
- static void forEach(void* data, void (*fun) (Face&, void*));
-
- static Face& UP;
- static Face& DOWN;
- static Face& NORTH;
- static Face& SOUTH;
- static Face& EAST;
- static Face& WEST;
- private:
- Face(int index, int offsetX, int offsetY, int offsetZ, const char* name);
-
- static Face FACES[6];
-
- int offsetX;
- int offsetY;
- int offsetZ;
-
- int index;
-
- 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
|