PrismLauncher/api/logic/minecraft/ComponentUpdateTask.h

38 lines
733 B
C
Raw Normal View History

#pragma once
#include "tasks/Task.h"
#include "net/Mode.h"
#include <memory>
class ComponentList;
struct ComponentUpdateTaskData;
class ComponentUpdateTask : public Task
{
2018-07-15 13:51:05 +01:00
Q_OBJECT
public:
2018-07-15 13:51:05 +01:00
enum class Mode
{
Launch,
Resolution
};
public:
2018-07-15 13:51:05 +01:00
explicit ComponentUpdateTask(Mode mode, Net::Mode netmode, ComponentList * list, QObject *parent = 0);
virtual ~ComponentUpdateTask();
protected:
2018-07-15 13:51:05 +01:00
void executeTask();
private:
2018-07-15 13:51:05 +01:00
void loadComponents();
void resolveDependencies(bool checkOnly);
2018-07-15 13:51:05 +01:00
void remoteLoadSucceeded(size_t index);
void remoteLoadFailed(size_t index, const QString &msg);
void checkIfAllFinished();
private:
2018-07-15 13:51:05 +01:00
std::unique_ptr<ComponentUpdateTaskData> d;
};