#ifndef LOTROMANAGER_H
#define LOTROMANAGER_H

#include <QObject>
#include <QPushButton>

#include <queue>
#include <functional>

#include <LotroDat.h>

class LotroManager : public QObject
{
    Q_OBJECT
private:
    explicit LotroManager(QObject *parent = nullptr);

public:
    static LotroManager& getInstance() {
       static LotroManager lotro_mgr_instance;
       return lotro_mgr_instance;
    }

    void startGame();

    bool openDatFile(int id);

    void applyPatch(QString name);

    void applyGlobal();

    bool isDatReady();

    int checkDatFile();

    void applyMicroPatch();

    void applyLoadscreens();

    bool setGameLocale(QString locale);

    void saveLocale(int locale, QPushButton *button);

    void saveDatFiles();

public:
    void processFile();

    void installMicroPatch();

    void prepareMicroPatch();

public:
    LOTRO_DAT::LOCALE dat_locale_;
    std::vector<LOTRO_DAT::DatFile> dat_files_;
    LOTRO_DAT::Database database_;

signals:

private slots:
    void handleFinisheddd();
    //void processQueue();
};

#endif // LOTROMANAGER_H
