#pragma once #include "Types.h" #include "nbt/NBT.h" #include "PalettedContainer.h" #include "block/state/BlockState.h" #include namespace Feather { // 16x16x16 sections of a chunk struct ChunkSection { static constexpr size_t MaximumLongCount = (16 * 16 * 16) * 14 / 64; std::array blockStates; // TODO: this should eventually be Palette // Palette of local indexs to indexs in the global palette IDMapper localPalette; uint8_t bitsPerBlock; }; // Chunk: 16x256x16 world chunk class Chunk { public: static constexpr int NUM_SECTIONS = 16; // Each chunk is made of up 16 ChunkSections ChunkSection sections[NUM_SECTIONS]; ChunkPos pos; // TODO: save heightmaps here // UNSERIALIZED //const NBT::CompoundTag* heightmaps; Chunk(ChunkPos& pos, NBT::CompoundTag& tag); }; };