World.h 445 B

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