summary refs log tree commit diff
path: root/src/World/Position.hpp
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2023-08-03 02:29:44 +0200
committerMel <einebeere@gmail.com>2023-08-03 02:31:12 +0200
commit1d574e5e8fe3f08d13f1b8c4444fc4cb02cf0faf (patch)
treed151baab68d6aa444a5968a1b579c5d48025084e /src/World/Position.hpp
parent15352db7bc03a176ea7a184f40a7f4e72b54b5fe (diff)
downloadmeowcraft-1d574e5e8fe3f08d13f1b8c4444fc4cb02cf0faf.tar.zst
meowcraft-1d574e5e8fe3f08d13f1b8c4444fc4cb02cf0faf.zip
World can now reassess chunk generation priorities on player movement and cancel no longer needed jobs
Diffstat (limited to 'src/World/Position.hpp')
-rw-r--r--src/World/Position.hpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/World/Position.hpp b/src/World/Position.hpp
index b603ee4..07de6f3 100644
--- a/src/World/Position.hpp
+++ b/src/World/Position.hpp
@@ -1,19 +1,23 @@
 #pragma once
 
 #include "array"
+#include "ChunkDimensions.hpp"
 #include "../Math/Vector.hpp"
 
-namespace MC::World::Position {
+namespace MC::Position {
 
 // Position within entire world.
 using World = Vector<3>;
 
+// Offset between two world positions.
+using WorldOffset = Vector<3>;
+
 // Offset between block positions within single chunk.
 class BlockOffset : public Vector<3, I16> {
 public:
     BlockOffset(I16 x, I16 y, I16 z) : Vector(x, y, z) {}
     Bool fits_within_chunk() const {
-        using namespace ChunkDimensions;
+        using namespace MC::World::ChunkDimensions;
         return x() >= 0 && x() < Width && y() >= 0 && y() < Height && z() >= 0 && z() < Width;
     }
 };