summaryrefslogtreecommitdiffstats
path: root/World.hpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-04-15 12:17:53 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-04-15 12:17:53 +0200
commit2ee0f834487cfe4b6bd9424ca2715685a8db16e4 (patch)
tree6867718d6bfcd42f6a82c86dd8f149d6ea6cab68 /World.hpp
downloadAltCraft-2ee0f834487cfe4b6bd9424ca2715685a8db16e4.tar
AltCraft-2ee0f834487cfe4b6bd9424ca2715685a8db16e4.tar.gz
AltCraft-2ee0f834487cfe4b6bd9424ca2715685a8db16e4.tar.bz2
AltCraft-2ee0f834487cfe4b6bd9424ca2715685a8db16e4.tar.lz
AltCraft-2ee0f834487cfe4b6bd9424ca2715685a8db16e4.tar.xz
AltCraft-2ee0f834487cfe4b6bd9424ca2715685a8db16e4.tar.zst
AltCraft-2ee0f834487cfe4b6bd9424ca2715685a8db16e4.zip
Diffstat (limited to 'World.hpp')
-rw-r--r--World.hpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/World.hpp b/World.hpp
new file mode 100644
index 0000000..288dc4f
--- /dev/null
+++ b/World.hpp
@@ -0,0 +1,28 @@
+#pragma once
+
+#include <map>
+#include "Block.hpp"
+#include "Packet.hpp"
+
+const int SECTION_WIDTH=16;
+const int SECTION_LENGTH=16;
+const int SECTION_HEIGHT=16;
+
+class World {
+public:
+ Block &GetBlock(PositionI pos);
+ void SetBlock(PositionI pos, Block block);
+ void ParseChunkData(Packet packet);
+
+
+ std::map<PositionI,Block> m_blocks;
+private:
+
+
+ size_t ParseSectionData(int chunkX, int chunkZ, bool isGroundContinous, int section, byte *data);
+
+ std::vector<unsigned short>
+ ParseBlocks(byte *bytes, int dataLength, std::vector<int> palette, byte bitsPerBlock);
+
+ int m_dimension=0;
+}; \ No newline at end of file