From 4aec51ee6976f1ca7596d3870689bb761fffd56d Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Tue, 6 Mar 2018 20:04:56 +0500 Subject: Simplified Section class --- src/Section.cpp | 41 ----------------------------------------- src/Section.hpp | 18 ++++-------------- 2 files changed, 4 insertions(+), 55 deletions(-) diff --git a/src/Section.cpp b/src/Section.cpp index 2f72411..71937e2 100644 --- a/src/Section.cpp +++ b/src/Section.cpp @@ -52,26 +52,6 @@ Section::Section(Vector pos, unsigned char bitsPerBlock, std::vectorblock = other.block; - this->light = other.light; - this->sky = other.sky; - this->bitsPerBlock = other.bitsPerBlock; - this->palette = other.palette; - this->hash = other.hash; - this->worldPosition = other.worldPosition; -} - Vector Section::GetPosition() const { return worldPosition; } diff --git a/src/Section.hpp b/src/Section.hpp index e647600..7617c24 100644 --- a/src/Section.hpp +++ b/src/Section.hpp @@ -10,11 +10,11 @@ class Section { std::vector block; std::vector light; std::vector sky; - unsigned char bitsPerBlock; + unsigned char bitsPerBlock = 0; std::vector palette; Vector worldPosition; - mutable size_t hash; + mutable size_t hash = 0; void CalculateHash() const; @@ -22,16 +22,8 @@ class Section { 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; - + Section() = default; + BlockId GetBlockId(Vector pos) const; unsigned char GetBlockLight(Vector pos) const; @@ -47,6 +39,4 @@ public: Vector GetPosition() const; size_t GetHash() const; - - friend void swap(Section& lhs, Section& rhs) noexcept; }; \ No newline at end of file -- cgit v1.2.3