sneedmc/launcher/minecraft/ComponentUpdateTask.h

38 lines
729 B
C
Raw Normal View History

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