summaryrefslogtreecommitdiffstats
path: root/api/logic/minecraft/ComponentUpdateTask.h
blob: 11d122b6b96c7914f4387f29279abda8934d9104 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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;
};