From f5aa7827af55342a1ec714d366944b3e3f3129b2 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Wed, 21 Jun 2017 19:26:25 +0500 Subject: 2017-06-21 --- src/world/Section.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/world/Section.cpp') diff --git a/src/world/Section.cpp b/src/world/Section.cpp index 8f94ad7..a338e49 100644 --- a/src/world/Section.cpp +++ b/src/world/Section.cpp @@ -1,8 +1,11 @@ -#include "Section.hpp" +#include -Section::Section(byte *dataBlocks, size_t dataBlocksLength, byte *dataLight, byte *dataSky, byte bitsPerBlock, +Section::Section(Vector position, byte *dataBlocks, size_t dataBlocksLength, byte *dataLight, byte *dataSky, + byte bitsPerBlock, std::vector palette) { + worldPosition = position; + m_dataBlocksLen = dataBlocksLength; m_dataBlocks = new byte[m_dataBlocksLen]; std::copy(dataBlocks, dataBlocks + m_dataBlocksLen, m_dataBlocks); @@ -97,7 +100,7 @@ void Section::Parse() { } Section &Section::operator=(Section other) { - std::swap(*this,other); + std::swap(*this, other); return *this; } @@ -113,6 +116,7 @@ void swap(Section &a, Section &b) { } Section::Section(const Section &other) { + worldPosition = other.worldPosition; m_dataBlocksLen = other.m_dataBlocksLen; m_dataBlocks = new byte[m_dataBlocksLen]; std::copy(other.m_dataBlocks, other.m_dataBlocks + m_dataBlocksLen, m_dataBlocks); @@ -127,4 +131,8 @@ Section::Section(const Section &other) { m_palette = other.m_palette; m_bitsPerBlock = other.m_bitsPerBlock; -} \ No newline at end of file +} + +Vector Section::GetPosition() { + return worldPosition; +} -- cgit v1.2.3