aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/Rule.h
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/minecraft/Rule.h')
-rw-r--r--launcher/minecraft/Rule.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/launcher/minecraft/Rule.h b/launcher/minecraft/Rule.h
index 2ed49d78..4c75cee4 100644
--- a/launcher/minecraft/Rule.h
+++ b/launcher/minecraft/Rule.h
@@ -37,7 +37,7 @@ class Rule
{
protected:
RuleAction m_result;
- virtual bool applies(const Library *parent) = 0;
+ virtual bool applies(const Library *parent, const RuntimeContext & runtimeContext) = 0;
public:
Rule(RuleAction result) : m_result(result)
@@ -45,9 +45,9 @@ public:
}
virtual ~Rule() {};
virtual QJsonObject toJson() = 0;
- RuleAction apply(const Library *parent)
+ RuleAction apply(const Library *parent, const RuntimeContext & runtimeContext)
{
- if (applies(parent))
+ if (applies(parent, runtimeContext))
return m_result;
else
return Defer;
@@ -63,9 +63,9 @@ private:
QString m_version_regexp;
protected:
- virtual bool applies(const Library *)
+ virtual bool applies(const Library *, const RuntimeContext & runtimeContext)
{
- return (m_system == RuntimeContext::currentSystem());
+ return runtimeContext.classifierMatches(m_system);
}
OsRule(RuleAction result, QString system, QString version_regexp)
: Rule(result), m_system(system), m_version_regexp(version_regexp)
@@ -84,7 +84,7 @@ public:
class ImplicitRule : public Rule
{
protected:
- virtual bool applies(const Library *)
+ virtual bool applies(const Library *, const RuntimeContext & runtimeContext)
{
return true;
}