World.h 427 B

12345678910111213141516171819202122
  1. #ifndef WORLD_H
  2. #define WORLD_H
  3. #include "common/world/Chunk.h"
  4. class World final
  5. {
  6. public:
  7. void setBlock(u32 x, u32 y, u32 z, const Block& block);
  8. const Block& getBlock(u32 x, u32 y, u32 z) const;
  9. static const u32 WORLD_SIZE = 256;
  10. private:
  11. static const u32 BITMASK = WORLD_SIZE - 1;
  12. Chunk chunks[WORLD_SIZE >> Chunk::CHUNK_BIT_SIZE][WORLD_SIZE >> Chunk::CHUNK_BIT_SIZE];
  13. };
  14. #endif