X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2FChunkLoader.hpp;h=c9fb8aa2f574e1721ef568ce2be95604f31ff2b0;hb=46b18a88fdda816f3c2c547aba68b0a5ea7970f7;hp=98b352fbc6e228c08b25c75e15954f01a5652184;hpb=55dbd6b35a39888f245e247d2e140f141f918178;p=blank.git diff --git a/src/world/ChunkLoader.hpp b/src/world/ChunkLoader.hpp index 98b352f..c9fb8aa 100644 --- a/src/world/ChunkLoader.hpp +++ b/src/world/ChunkLoader.hpp @@ -41,8 +41,14 @@ public: 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::iterator Remove(std::list::iterator) noexcept; private: Chunk::Pos base;