[commands] Allow composing two triggers directly (#4580)

For backwards compatibility reasons.
This commit is contained in:
Dustin Spicuzza
2022-11-07 12:55:28 -05:00
committed by GitHub
parent 0190301e09
commit a4054d702f

View File

@@ -487,6 +487,15 @@ class Trigger {
return m_event.operator&&(rhs).CastTo<Trigger>();
}
/**
* Composes two triggers with logical AND.
*
* @return A trigger which is active when both component triggers are active.
*/
Trigger operator&&(Trigger& rhs) {
return (m_event && rhs.m_event).CastTo<Trigger>();
}
/**
* Composes two triggers with logical OR.
*
@@ -496,6 +505,15 @@ class Trigger {
return m_event.operator||(rhs).CastTo<Trigger>();
}
/**
* Composes two triggers with logical OR.
*
* @return A trigger which is active when either component trigger is active.
*/
Trigger operator||(Trigger& rhs) {
return (m_event || rhs.m_event).CastTo<Trigger>();
}
/**
* Composes a trigger with logical NOT.
*