1 #ifndef BLANK_WORLD_CHUNKLOADER_HPP_
2 #define BLANK_WORLD_CHUNKLOADER_HPP_
5 #include "../app/IntervalTimer.hpp"
12 class BlockTypeRegistry;
24 ChunkLoader(const Config &, const BlockTypeRegistry &, const Generator &) noexcept;
26 void Generate(const Chunk::Pos &from, const Chunk::Pos &to);
27 void GenerateSurrounding(const Chunk::Pos &);
29 std::list<Chunk> &Loaded() noexcept { return loaded; }
31 Chunk *Loaded(const Chunk::Pos &) noexcept;
32 bool Queued(const Chunk::Pos &) noexcept;
33 bool Known(const Chunk::Pos &) noexcept;
34 Chunk &ForceLoad(const Chunk::Pos &);
36 bool OutOfRange(const Chunk &c) const noexcept { return OutOfRange(c.Position()); }
37 bool OutOfRange(const Chunk::Pos &) const noexcept;
39 void Rebase(const Chunk::Pos &);
43 Chunk &Generate(const Chunk::Pos &pos);
44 void Insert(Chunk &) noexcept;
45 void Remove(Chunk &) noexcept;
50 const BlockTypeRegistry ®
53 std::list<Chunk> loaded;
54 std::list<Chunk::Pos> to_generate;
55 std::list<Chunk> to_free;
57 IntervalTimer gen_timer;