Wraps a condition set on a Module instance.
bool evaluate(int value) const
evaluate the condition using the given value.
ModuleCondition(std::string expression, std::shared_ptr< Path > conditionPath, EAfterConditionPath afterConditionPath)
initialize from string expression (see class doc).
std::shared_ptr< Path > m_conditionPath
The path which which will be executed if the condition is evaluated to true.
EConditionOperators m_conditionOperator
The operator of the condition (set by parsing the condition expression).
EConditionOperators
The supported condition operators.
@ c_GE
Greater or equal than: ">=".
@ c_SE
Smaller or equal than: "<=".
std::string getString() const
A string representation of this condition.
EAfterConditionPath
Different options for behaviour after a conditional path was executed.
@ c_End
End current event after the conditional path.
@ c_Continue
After the conditional path, resume execution after this module.
EAfterConditionPath m_afterConditionPath
What to do after a conditional path is finished.
EConditionOperators getConditionOperator() const
Returns the value of the condition.
int m_conditionValue
Numeric value used in the condition (set by parsing the condition expression).
const std::shared_ptr< Path > & getPath() const
Returns the path of the condition.
~ModuleCondition()=default
Destructor, nothing to see here.
int getConditionValue() const
Returns the value of the condition.
EAfterConditionPath getAfterConditionPath() const
What to do after a conditional path is finished.
static void exposePythonAPI()
Exposes methods of the ModuleCondition class to Python.
ModuleCondition & operator=(const ModuleCondition &other)=default
and default assignment operator
ModuleCondition(const ModuleCondition &other)=default
default copy constructor.
ModuleCondition()=delete
no default constructed objects.
Abstract base class for different kinds of events.