#pragma once #include #include #include "Block.hpp" #include "Vector.hpp" class Section { std::vector block; unsigned char light[2048] = {}; unsigned char sky[2048] = {}; unsigned char bitsPerBlock = 0; std::vector palette; Vector worldPosition; mutable size_t hash = 0; void CalculateHash() const; std::map overrideList; public: Section(Vector pos, unsigned char bitsPerBlock, std::vector palette, std::vector blockData, const std::vector &lightData, const std::vector &skyData); Section() = default; BlockId GetBlockId(Vector pos) const; unsigned char GetBlockLight(Vector pos) const; unsigned char GetBlockSkyLight(Vector pos) const; void SetBlockId(Vector pos, BlockId value); void SetBlockLight(Vector pos, unsigned char value); void SetBlockSkyLight(Vector pos, unsigned char value); Vector GetPosition() const; size_t GetHash() const; };