Added Dependency API
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
11f8d25d94
commit
5655a33515
5 changed files with 93 additions and 32 deletions
|
@ -111,6 +111,24 @@ class ResourceAPI {
|
|||
std::function<void(QJsonDocument&, ModPlatform::IndexedPack)> on_succeed;
|
||||
};
|
||||
|
||||
struct DependencySearchArgs {
|
||||
ModPlatform::Dependency dependency;
|
||||
Version mcVersion;
|
||||
ModLoaderTypes loader;
|
||||
|
||||
DependencySearchArgs(DependencySearchArgs const&) = default;
|
||||
void operator=(DependencySearchArgs other)
|
||||
{
|
||||
dependency = other.dependency;
|
||||
mcVersion = other.mcVersion;
|
||||
loader = other.loader;
|
||||
}
|
||||
};
|
||||
|
||||
struct DependencySearchCallbacks {
|
||||
std::function<void(QJsonDocument&, ModPlatform::Dependency)> on_succeed;
|
||||
};
|
||||
|
||||
public:
|
||||
/** Gets a list of available sorting methods for this API. */
|
||||
[[nodiscard]] virtual auto getSortingMethods() const -> QList<SortingMethod> = 0;
|
||||
|
@ -143,6 +161,12 @@ class ResourceAPI {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
[[nodiscard]] virtual Task::Ptr getDependencyVersion(DependencySearchArgs&&, DependencySearchCallbacks&&) const
|
||||
{
|
||||
qWarning() << "TODO";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static auto getModLoaderString(ModLoaderType type) -> const QString
|
||||
{
|
||||
switch (type) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue