]> git.localhorst.tv Git - blank.git/blobdiff - src/standalone/UnloadState.cpp
make command output visible to player(s)
[blank.git] / src / standalone / UnloadState.cpp
diff --git a/src/standalone/UnloadState.cpp b/src/standalone/UnloadState.cpp
deleted file mode 100644 (file)
index 0b48904..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#include "UnloadState.hpp"
-
-#include "../app/Environment.hpp"
-#include "../io/WorldSave.hpp"
-#include "../world/ChunkLoader.hpp"
-
-
-namespace blank {
-namespace standalone {
-
-UnloadState::UnloadState(
-       Environment &env,
-       ChunkStore &chunks,
-       const WorldSave &save)
-: ProgressState(env, "Unloading chunks: %d/%d (%d%%)")
-, env(env)
-, chunks(chunks)
-, save(save)
-, cur(chunks.begin())
-, end(chunks.end())
-, done(0)
-, total(chunks.NumLoaded())
-, per_update(64) {
-
-}
-
-
-void UnloadState::OnResume() {
-       cur = chunks.begin();
-       end = chunks.end();
-       done = 0;
-       total = chunks.NumLoaded();
-}
-
-
-void UnloadState::Handle(const SDL_Event &) {
-       // ignore everything
-}
-
-void UnloadState::Update(int dt) {
-       for (std::size_t i = 0; i < per_update && cur != end; ++i, ++cur, ++done) {
-               if (cur->ShouldUpdateSave()) {
-                       save.Write(*cur);
-               }
-       }
-       if (cur == end) {
-               env.state.Pop();
-       } else {
-               SetProgress(done, total);
-       }
-}
-
-}
-}