pollymc/launcher/minecraft/ComponentUpdateTask.h

38 lines
729 B
C
Raw Permalink 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 18:21:05 +05:30
Q_OBJECT
public:
2018-07-15 18:21:05 +05:30
enum class Mode
{
Launch,
Resolution
};
public:
explicit ComponentUpdateTask(Mode mode, Net::Mode netmode, PackProfile * list, QObject *parent = 0);
2018-07-15 18:21:05 +05:30
virtual ~ComponentUpdateTask();
protected:
2018-07-15 18:21:05 +05:30
void executeTask();
private:
2018-07-15 18:21:05 +05:30
void loadComponents();
void resolveDependencies(bool checkOnly);
2018-07-15 18:21:05 +05:30
void remoteLoadSucceeded(size_t index);
void remoteLoadFailed(size_t index, const QString &msg);
void checkIfAllFinished();
private:
2018-07-15 18:21:05 +05:30
std::unique_ptr<ComponentUpdateTaskData> d;
};