]> git.localhorst.tv Git - blank.git/blob - src/app/UnloadState.hpp
try to get every chunk change saved to disk
[blank.git] / src / app / UnloadState.hpp
1 #ifndef BLANK_APP_PRELOADSTATE_HPP_
2 #define BLANK_APP_PRELOADSTATE_HPP_
3
4 #include "State.hpp"
5
6 #include "../ui/Progress.hpp"
7 #include "../graphics/Font.hpp"
8
9 #include <cstddef>
10 #include <list>
11
12
13 namespace blank {
14
15 class Chunk;
16 class ChunkLoader;
17 class Environment;
18
19 class UnloadState
20 : public State {
21
22 public:
23         UnloadState(Environment &, ChunkLoader &);
24
25         void Handle(const SDL_Event &) override;
26         void Update(int dt) override;
27         void Render(Viewport &) override;
28
29 private:
30         Environment &env;
31         ChunkLoader &loader;
32         Font font;
33         Progress progress;
34         std::list<Chunk>::iterator cur;
35         std::list<Chunk>::iterator end;
36         std::size_t done;
37         std::size_t total;
38         std::size_t per_update;
39
40 };
41
42 }
43
44 #endif