2022-03-03 02:01:23 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QString>
|
2022-03-24 21:39:53 +00:00
|
|
|
#include <QList>
|
2022-03-03 02:01:23 +00:00
|
|
|
|
2022-03-07 19:22:57 +00:00
|
|
|
namespace ModPlatform {
|
|
|
|
class ListModel;
|
|
|
|
}
|
|
|
|
|
2022-03-03 02:01:23 +00:00
|
|
|
class ModAPI {
|
2022-03-07 19:22:57 +00:00
|
|
|
protected:
|
|
|
|
using CallerType = ModPlatform::ListModel;
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual ~ModAPI() = default;
|
|
|
|
|
|
|
|
// https://docs.curseforge.com/?http#tocS_ModLoaderType
|
2022-02-20 19:55:26 +00:00
|
|
|
enum ModLoaderType { Any = 0, Forge = 1, Cauldron = 2, LiteLoader = 3, Fabric = 4, Quilt = 5 };
|
2022-03-03 02:01:23 +00:00
|
|
|
|
2022-03-07 19:22:57 +00:00
|
|
|
struct SearchArgs {
|
|
|
|
int offset;
|
|
|
|
QString search;
|
|
|
|
QString sorting;
|
|
|
|
ModLoaderType mod_loader;
|
|
|
|
QString version;
|
|
|
|
};
|
2022-03-06 19:45:39 +00:00
|
|
|
|
2022-03-07 19:46:08 +00:00
|
|
|
virtual void searchMods(CallerType* caller, SearchArgs&& args) const = 0;
|
2022-03-24 21:39:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
struct VersionSearchArgs {
|
|
|
|
QString addonId;
|
|
|
|
QList<QString> mcVersions;
|
|
|
|
ModLoaderType loader;
|
|
|
|
};
|
|
|
|
|
|
|
|
virtual void getVersions(CallerType* caller, VersionSearchArgs&& args) const = 0;
|
2022-03-03 02:01:23 +00:00
|
|
|
};
|