pollymc/api/logic/minecraft/ProfilePatch.h
Petr Mrázek 5fabb4f254 NOISSUE Rough refactor of ProfilePatch and VersionFile internals.
They are now distinct classes with distinct responsibilities.

* ProfilePatch is an entry in MinecraftProfile and can hold VersionFile or Meta::Version.
* VersionFile is the basic element that holds version information loaded from JSON.
* Meta::Version is the loader class for VersionFile(s) from a server.
2017-04-07 00:20:02 +02:00

68 lines
1.5 KiB
C++

#pragma once
#include <memory>
#include <QList>
#include <QJsonDocument>
#include <QDateTime>
#include "JarMod.h"
#include "ProblemProvider.h"
class MinecraftProfile;
namespace Meta
{
class Version;
}
class VersionFile;
class ProfilePatch : public ProblemProvider
{
public:
ProfilePatch(std::shared_ptr<Meta::Version> version);
ProfilePatch(std::shared_ptr<VersionFile> file, const QString &filename = QString());
virtual ~ProfilePatch(){};
virtual void applyTo(MinecraftProfile *profile);
virtual bool isMoveable();
virtual bool isCustomizable();
virtual bool isRevertible();
virtual bool isRemovable();
virtual bool isCustom();
virtual bool isVersionChangeable();
virtual void setOrder(int order);
virtual int getOrder();
virtual QString getID();
virtual QString getName();
virtual QString getVersion();
virtual QDateTime getReleaseDateTime();
virtual QString getFilename();
virtual std::shared_ptr<class VersionFile> getVersionFile();
void setVanilla (bool state);
void setRemovable (bool state);
void setRevertible (bool state);
void setCustomizable (bool state);
void setMovable (bool state);
protected:
// Properties for UI and version manipulation from UI in general
bool m_isMovable = false;
bool m_isCustomizable = false;
bool m_isRevertible = false;
bool m_isRemovable = false;
bool m_isVanilla = false;
bool m_orderOverride = false;
int m_order = 0;
std::shared_ptr<Meta::Version> m_metaVersion;
std::shared_ptr<VersionFile> m_file;
QString m_filename;
};
typedef std::shared_ptr<ProfilePatch> ProfilePatchPtr;