5fabb4f254
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.
55 lines
951 B
C++
55 lines
951 B
C++
#pragma once
|
|
|
|
enum class ProblemSeverity
|
|
{
|
|
None,
|
|
Warning,
|
|
Error
|
|
};
|
|
|
|
class PatchProblem
|
|
{
|
|
public:
|
|
PatchProblem(ProblemSeverity severity, const QString & description)
|
|
{
|
|
m_severity = severity;
|
|
m_description = description;
|
|
}
|
|
const QString & getDescription() const
|
|
{
|
|
return m_description;
|
|
}
|
|
const ProblemSeverity getSeverity() const
|
|
{
|
|
return m_severity;
|
|
}
|
|
private:
|
|
ProblemSeverity m_severity;
|
|
QString m_description;
|
|
};
|
|
|
|
class ProblemProvider
|
|
{
|
|
public:
|
|
virtual const QList<PatchProblem>& getProblems()
|
|
{
|
|
return m_problems;
|
|
}
|
|
virtual void addProblem(ProblemSeverity severity, const QString &description)
|
|
{
|
|
if(severity > m_problemSeverity)
|
|
{
|
|
m_problemSeverity = severity;
|
|
}
|
|
m_problems.append(PatchProblem(severity, description));
|
|
}
|
|
virtual ProblemSeverity getProblemSeverity()
|
|
{
|
|
return m_problemSeverity;
|
|
}
|
|
|
|
private:
|
|
QList<PatchProblem> m_problems;
|
|
ProblemSeverity m_problemSeverity = ProblemSeverity::None;
|
|
};
|