all of this because keeping things compatible with deprecated old settings if either of the settings {a, b} is true, this also resolves to true
| 94 | // all of this because keeping things compatible with deprecated old settings |
| 95 | // if either of the settings {a, b} is true, this also resolves to true |
| 96 | class OrSetting : public Setting |
| 97 | { |
| 98 | Q_OBJECT |
| 99 | public: |
| 100 | OrSetting(QString id, std::shared_ptr<Setting> a, std::shared_ptr<Setting> b) |
| 101 | :Setting({id}, false), m_a(a), m_b(b) |
| 102 | { |
| 103 | } |
| 104 | virtual QVariant get() const |
| 105 | { |
| 106 | bool a = m_a->get().toBool(); |
| 107 | bool b = m_b->get().toBool(); |
| 108 | return a || b; |
| 109 | } |
| 110 | virtual void reset() {} |
| 111 | virtual void set(QVariant value) {} |
| 112 | private: |
| 113 | std::shared_ptr<Setting> m_a; |
| 114 | std::shared_ptr<Setting> m_b; |
| 115 | }; |
| 116 | |
| 117 | MinecraftInstance::MinecraftInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir) |
| 118 | : BaseInstance(globalSettings, settings, rootDir) |