Face.h 804 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef FACE_H
  2. #define FACE_H
  3. #include <iostream>
  4. class Face
  5. {
  6. public:
  7. int getX() const;
  8. int getY() const;
  9. int getZ() const;
  10. Face& getOpposite() const;
  11. const char* getName() const;
  12. static void forEach(void* data, void (*fun) (Face&, void*));
  13. static Face& UP;
  14. static Face& DOWN;
  15. static Face& NORTH;
  16. static Face& SOUTH;
  17. static Face& EAST;
  18. static Face& WEST;
  19. private:
  20. Face(int index, int offsetX, int offsetY, int offsetZ, const char* name);
  21. static Face FACES[6];
  22. int offsetX;
  23. int offsetY;
  24. int offsetZ;
  25. int index;
  26. const char* name;
  27. };
  28. bool operator==(const Face& l, const Face& r);
  29. bool operator!=(const Face& l, const Face& r);
  30. std::ostream& operator<<(std::ostream& os, const Face& f);
  31. #endif