2022-03-03 07:31:23 +05:30
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QString>
|
2022-03-25 03:09:53 +05:30
|
|
|
#include <QList>
|
2022-03-03 07:31:23 +05:30
|
|
|
|
2022-03-08 00:52:57 +05:30
|
|
|
namespace ModPlatform {
|
|
|
|
class ListModel;
|
|
|
|
}
|
|
|
|
|
2022-03-03 07:31:23 +05:30
|
|
|
class ModAPI {
|
2022-03-08 00:52:57 +05:30
|
|
|
protected:
|
|
|
|
using CallerType = ModPlatform::ListModel;
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual ~ModAPI() = default;
|
|
|
|
|
|
|
|
// https://docs.curseforge.com/?http#tocS_ModLoaderType
|
|
|
|
enum ModLoaderType { Any = 0, Forge = 1, Cauldron = 2, LiteLoader = 3, Fabric = 4 };
|
2022-03-03 07:31:23 +05:30
|
|
|
|
2022-03-08 00:52:57 +05:30
|
|
|
struct SearchArgs {
|
|
|
|
int offset;
|
|
|
|
QString search;
|
|
|
|
QString sorting;
|
|
|
|
ModLoaderType mod_loader;
|
|
|
|
QString version;
|
|
|
|
};
|
2022-03-07 01:15:39 +05:30
|
|
|
|
2022-03-08 01:16:08 +05:30
|
|
|
virtual void searchMods(CallerType* caller, SearchArgs&& args) const = 0;
|
2022-03-25 03:09:53 +05:30
|
|
|
|
|
|
|
|
|
|
|
struct VersionSearchArgs {
|
|
|
|
QString addonId;
|
|
|
|
QList<QString> mcVersions;
|
|
|
|
ModLoaderType loader;
|
|
|
|
};
|
|
|
|
|
|
|
|
virtual void getVersions(CallerType* caller, VersionSearchArgs&& args) const = 0;
|
2022-03-03 07:31:23 +05:30
|
|
|
};
|