diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-04-14 18:59:31 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-04-21 18:42:05 +0300 |
commit | 5655a3351551aa36aeeba79b0ac7f2474ca74352 (patch) | |
tree | 1090b87b97dad78e5ecbfa8b19ee14ad2ef973f0 /launcher/modplatform/ResourceAPI.h | |
parent | 11f8d25d94296aab13f885fde14ff26767082600 (diff) | |
download | PrismLauncher-5655a3351551aa36aeeba79b0ac7f2474ca74352.tar.gz PrismLauncher-5655a3351551aa36aeeba79b0ac7f2474ca74352.tar.bz2 PrismLauncher-5655a3351551aa36aeeba79b0ac7f2474ca74352.zip |
Added Dependency API
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/modplatform/ResourceAPI.h')
-rw-r--r-- | launcher/modplatform/ResourceAPI.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/launcher/modplatform/ResourceAPI.h b/launcher/modplatform/ResourceAPI.h index 34f33779..a8e144dc 100644 --- a/launcher/modplatform/ResourceAPI.h +++ b/launcher/modplatform/ResourceAPI.h @@ -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) { |