summaryrefslogtreecommitdiffstats
path: root/api/logic/minecraft/ComponentUpdateTask.h
diff options
context:
space:
mode:
Diffstat (limited to 'api/logic/minecraft/ComponentUpdateTask.h')
-rw-r--r--api/logic/minecraft/ComponentUpdateTask.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/api/logic/minecraft/ComponentUpdateTask.h b/api/logic/minecraft/ComponentUpdateTask.h
new file mode 100644
index 00000000..11d122b6
--- /dev/null
+++ b/api/logic/minecraft/ComponentUpdateTask.h
@@ -0,0 +1,37 @@
+#pragma once
+
+#include "tasks/Task.h"
+#include "net/Mode.h"
+
+#include <memory>
+class ComponentList;
+struct ComponentUpdateTaskData;
+
+class ComponentUpdateTask : public Task
+{
+ Q_OBJECT
+public:
+ enum class Mode
+ {
+ Launch,
+ Resolution
+ };
+
+public:
+ explicit ComponentUpdateTask(Mode mode, Net::Mode netmode, ComponentList * list, QObject *parent = 0);
+ virtual ~ComponentUpdateTask();
+
+protected:
+ void executeTask();
+
+private:
+ void loadComponents();
+ void resolveDependencies(bool checkOnly);
+
+ void remoteLoadSucceeded(size_t index);
+ void remoteLoadFailed(size_t index, const QString &msg);
+ void checkIfAllFinished();
+
+private:
+ std::unique_ptr<ComponentUpdateTaskData> d;
+};