forked from MrBesen/lolautoaccept
55 lines
951 B
C++
55 lines
951 B
C++
#pragma once
|
|
|
|
#include <memory>
|
|
#include <QJsonObject>
|
|
|
|
#include "position.h"
|
|
|
|
class Config {
|
|
public:
|
|
struct StageConfig {
|
|
StageConfig();
|
|
StageConfig(const QJsonObject&);
|
|
operator QJsonObject() const;
|
|
|
|
std::vector<std::string> champs;
|
|
bool enabled = false;
|
|
};
|
|
|
|
struct PositionConfig {
|
|
PositionConfig();
|
|
PositionConfig(const QJsonObject&);
|
|
operator QJsonObject() const;
|
|
|
|
Position position; // top, bot, sup,...
|
|
|
|
StageConfig ban;
|
|
StageConfig pick;
|
|
};
|
|
|
|
struct RootConfig {
|
|
RootConfig();
|
|
RootConfig(const QJsonObject&);
|
|
operator QJsonObject() const;
|
|
|
|
std::shared_ptr<Config::PositionConfig> getPositionConfig(Position position);
|
|
|
|
std::vector<std::shared_ptr<PositionConfig>> positionConfigs;
|
|
|
|
bool enabledAutoAccept;
|
|
bool enabledSmiteWarn;
|
|
};
|
|
|
|
Config();
|
|
~Config();
|
|
|
|
bool load();
|
|
void save();
|
|
|
|
RootConfig& getConfig();
|
|
private:
|
|
std::string configFolderPath;
|
|
std::string configFilePath;
|
|
RootConfig root;
|
|
};
|