return true;
}
-
+bool SDL2FFBConditionEffect::operator==(const FFBEffect& other) const
+{
+ if (this->type() != other.type())
+ return false;
+ else {
+ try {
+ const SDL2FFBConditionEffect& cother = dynamic_cast<const SDL2FFBConditionEffect&>(other);
+ return this->m_params->subtype == cother.m_params->subtype;
+ } catch (std::bad_cast&) {
+ return false;
+ }
+ }
+}
inline const std::shared_ptr<FFBEffectParameters> parameters() const { return m_params; }
bool setParameters(std::shared_ptr<FFBEffectParameters> params);
+ bool operator==(const FFBEffect& other) const;
+
private:
bool setParameters(std::shared_ptr<FFBConditionEffectParameters> params);
return true;
}
+bool SDL2FFBPeriodicEffect::operator==(const FFBEffect& other) const
+{
+ if (this->type() != other.type())
+ return false;
+ else {
+ try {
+ const SDL2FFBPeriodicEffect& eff = dynamic_cast<const SDL2FFBPeriodicEffect&>(other);
+ return this->m_params->waveform == eff.m_params->waveform;
+ } catch(std::bad_cast&) {
+ return false;
+ }
+ }
+}
\ No newline at end of file
inline const std::shared_ptr<FFBEffectParameters> parameters() const { return m_params; }
bool setParameters(const std::shared_ptr<FFBEffectParameters> params);
+ bool operator==(const FFBEffect& other) const;
+
private:
bool setParameters(const std::shared_ptr<FFBPeriodicEffectParameters> params);