Face.h 975 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 index;
  25. int offsetX;
  26. int offsetY;
  27. int offsetZ;
  28. int cullBit;
  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