World: factor out Section handling to a generic interface

This commit is contained in:
Matthias Schiffer 2018-07-24 20:00:16 +02:00
parent dd432af298
commit 210f651807
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
7 changed files with 248 additions and 143 deletions

View file

@ -26,28 +26,25 @@
#pragma once
#include <cstdint>
#include "../NBT/CompoundTag.hpp"
#include "../Resource/BlockType.hpp"
namespace MinedMap {
namespace World {
struct Block {
uint8_t id;
uint8_t data;
const Resource::BlockType *type;
unsigned height;
uint8_t blockLight;
uint8_t skyLight;
uint8_t biome;
Block() : id(0), data(0), height(0), blockLight(0), skyLight(0), biome(0) {}
Block(uint8_t id0, uint8_t data0, unsigned height0, uint8_t blockLight0, uint8_t skyLight0, uint8_t biome0)
: id(id0), data(data0), height(height0), blockLight(blockLight0), skyLight(skyLight0), biome(biome0) {}
uint32_t getColor() const;
operator bool() const {
return type;
}
};
}