1234567891011121314151617181920212223 |
- #include "common/world/World.h"
- #include "common/world/HighMap.h"
- #include "utils/Random.h"
- World::World(const BlockRegistry& blockRegistry)
- : blockRegistry(blockRegistry), blocks(7, 7), dirty(true) {
- }
- void World::setBlock(int x, int y, int z, const Block& block) {
- blocks.set(x, y, z, block.getId());
- }
- const Block& World::getBlock(int x, int y, int z) const {
- return blockRegistry.getBlock(blocks.get(x, y, z));
- }
- int World::getSize() const {
- return blocks.getSize();
- }
- int World::getHeight() const {
- return blocks.getHeight();
- }
|