123456789101112131415161718192021 |
- #ifndef WORLD_H
- #define WORLD_H
- #include "common/block/BlockRegistry.h"
- class World final {
- public:
- World(const BlockRegistry& blockRegistry);
- void setBlock(uint x, uint y, uint z, const Block& block);
- const Block& getBlock(uint x, uint y, uint z) const;
-
- static constexpr uint WORLD_SIZE = 32;
- private:
- static constexpr uint BITMASK = WORLD_SIZE - 1;
- const BlockRegistry& blockRegistry;
- u16 blocks[WORLD_SIZE][WORLD_SIZE][WORLD_SIZE];
- };
- #endif
|