summaryrefslogtreecommitdiffstats
path: root/api/logic/minecraft/ComponentUpdateTask.h
blob: 4cb29a89d5604095d8f3678f14d1c4edc8e71eb7 (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;
};