]> git.localhorst.tv Git - blank.git/blobdiff - src/world/ChunkLoader.hpp
correct usage of quaternions :P
[blank.git] / src / world / ChunkLoader.hpp
index 98b352fbc6e228c08b25c75e15954f01a5652184..6a8c2c19ac30d2143d42f85f01512d68c63af531 100644 (file)
@@ -39,10 +39,20 @@ public:
        void Rebase(const Chunk::Pos &);
        void Update(int dt);
 
+       std::size_t ToLoad() const noexcept { return to_generate.size(); }
+       void LoadOne();
+       void LoadN(std::size_t n);
+
 private:
        Chunk &Generate(const Chunk::Pos &pos);
+       // link given chunk to all loaded neighbors
        void Insert(Chunk &) noexcept;
-       void Remove(Chunk &) noexcept;
+       // remove a loaded chunk
+       // this unlinks it from its neighbors as well as moves it to the free list
+       // given iterator must point to a chunk from the loaded list
+       // returns an iterator to the chunk following the removed one
+       // in the loaded list (end for the last one)
+       std::list<Chunk>::iterator Remove(std::list<Chunk>::iterator) noexcept;
 
 private:
        Chunk::Pos base;