#pragma once #include #include #include #include #include #include "Block.hpp" #include "Vector.hpp" #include "Utility.hpp" class Section { std::vector block; std::vector light; std::vector sky; unsigned char bitsPerBlock; std::vector palette; Vector worldPosition; size_t hash; void CalculateHash(); public: Section(Vector pos, unsigned char bitsPerBlock, std::vector palette, std::vector blockData, std::vector lightData, std::vector skyData); Section(); ~Section(); Section(const Section &other); Section(Section &&other) noexcept; Section &operator=(Section other) noexcept; 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; friend void swap(Section& lhs, Section& rhs) noexcept; };