Face.h 976 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. int getCullData() const;
  13. static void forEach(void* data, void (*fun) (Face&, void*));
  14. static Face& UP;
  15. static Face& DOWN;
  16. static Face& NORTH;
  17. static Face& SOUTH;
  18. static Face& EAST;
  19. static Face& WEST;
  20. static int getCullData(bool up, bool down, bool north, bool south, bool east, bool west);
  21. private:
  22. Face(int index, int offsetX, int offsetY, int offsetZ, int cullBit, const char* name);
  23. static Face FACES[6];
  24. int offsetX;
  25. int offsetY;
  26. int offsetZ;
  27. int cullBit;
  28. int index;
  29. const char* name;
  30. };
  31. bool operator==(const Face& l, const Face& r);
  32. bool operator!=(const Face& l, const Face& r);
  33. std::ostream& operator<<(std::ostream& os, const Face& f);
  34. #endif