#pragma once #include #include #include "position.h" #include "runepage.h" class Config { public: struct StageConfig { StageConfig(); StageConfig(const QJsonObject&); operator QJsonObject() const; std::vector champs; bool enabled = false; }; struct PositionConfig { PositionConfig(); PositionConfig(const QJsonObject&); operator QJsonObject() const; Position position; // top, bot, sup,... StageConfig ban; StageConfig pick; }; struct RunePageConfig { RunePageConfig(); RunePageConfig(QString name, const RunePage& rp); RunePageConfig(const QJsonObject&); operator QJsonObject() const; QString name; RunePage runepage; }; struct GeneralRunePageConfig { GeneralRunePageConfig(); GeneralRunePageConfig(const QJsonObject&); operator QJsonObject() const; bool autoSync; std::vector> runePages; }; struct RootConfig { RootConfig(); RootConfig(const QJsonObject&); operator QJsonObject() const; std::shared_ptr getPositionConfig(Position position); std::vector> positionConfigs; GeneralRunePageConfig runepagesConfig; bool enabledAutoAccept; bool enabledSmiteWarn; bool enabledAutoWrite; QString autoWriteText; }; Config(); ~Config(); bool load(); void save(); RootConfig& getConfig(); private: QString configFolderPath; QString configFilePath; RootConfig root; };