pollymc/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 18:21:05 +05:30
Q_OBJECT
public:
2018-07-15 18:21:05 +05:30
enum class Mode
{
Launch,
Resolution
};
public:
2018-07-15 18:21:05 +05:30
explicit ComponentUpdateTask(Mode mode, Net::Mode netmode, ComponentList * list, QObject *parent = 0);
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;
};