2023-07-14 11:31:28 +01:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
/*
|
|
|
|
* Prism Launcher - Minecraft Launcher
|
|
|
|
* Copyright (c) 2023 Trial97 <alexandru.tripon97@gmail.com>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, version 3.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2016-01-01 23:35:54 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "BaseVersion.h"
|
|
|
|
#include "JavaVersion.h"
|
|
|
|
|
2023-07-14 11:31:13 +01:00
|
|
|
struct JavaInstall : public BaseVersion {
|
|
|
|
JavaInstall() {}
|
|
|
|
JavaInstall(QString id, QString arch, QString path) : id(id), arch(arch), path(path) {}
|
2023-08-18 11:10:13 +01:00
|
|
|
virtual QString descriptor() override { return id.toString(); }
|
2016-01-01 23:35:54 +00:00
|
|
|
|
2023-08-18 11:10:13 +01:00
|
|
|
virtual QString name() override { return id.toString(); }
|
2016-01-01 23:35:54 +00:00
|
|
|
|
2023-08-18 11:10:13 +01:00
|
|
|
virtual QString typeString() const override { return arch; }
|
2016-01-01 23:35:54 +00:00
|
|
|
|
2023-07-14 11:32:18 +01:00
|
|
|
virtual bool operator<(BaseVersion& a) override;
|
|
|
|
virtual bool operator>(BaseVersion& a) override;
|
2023-07-14 11:31:13 +01:00
|
|
|
bool operator<(const JavaInstall& rhs);
|
|
|
|
bool operator==(const JavaInstall& rhs);
|
|
|
|
bool operator>(const JavaInstall& rhs);
|
2016-01-01 23:35:54 +00:00
|
|
|
|
|
|
|
JavaVersion id;
|
|
|
|
QString arch;
|
|
|
|
QString path;
|
|
|
|
bool recommended = false;
|
|
|
|
};
|
|
|
|
|
2023-10-23 05:34:11 +01:00
|
|
|
using JavaInstallPtr = std::shared_ptr<JavaInstall>;
|