BlockStorage.h 512 B

123456789101112131415161718192021222324252627
  1. #ifndef BLOCKSTORAGE_H
  2. #define BLOCKSTORAGE_H
  3. #include "common/world/BlockMap.h"
  4. #include "gaming-core/memory/UniquePointer.h"
  5. #include "gaming-core/utils/List.h"
  6. #include <memory>
  7. class BlockStorage final {
  8. int size;
  9. int height;
  10. int sizeMask;
  11. List<UniquePointer<BlockMap>> maps;
  12. public:
  13. BlockStorage(int sizeBits, int heightBits);
  14. BlockId get(int x, int y, int z) const;
  15. void set(int x, int y, int z, BlockId id);
  16. int getSize() const;
  17. int getHeight() const;
  18. };
  19. #endif