1 #include "UnloadState.hpp"
3 #include "../app/Environment.hpp"
4 #include "../io/WorldSave.hpp"
5 #include "../world/ChunkLoader.hpp"
11 UnloadState::UnloadState(
14 const WorldSave &save)
15 : ProgressState(env, "Unloading chunks: %d/%d (%d%%)")
22 , total(chunks.NumLoaded())
28 void UnloadState::OnResume() {
32 total = chunks.NumLoaded();
36 void UnloadState::Handle(const SDL_Event &) {
40 void UnloadState::Update(int dt) {
41 for (std::size_t i = 0; i < per_update && cur != end; ++i, ++cur, ++done) {
42 if (cur->ShouldUpdateSave()) {
49 SetProgress(done, total);