#include "rule.h" namespace domain { Condition::Condition(std::string function, std::vector params, bool negated) : negated(negated), function(function), params(params) {} bool Condition::evaluate(RuleContext &context) { std::vector request; for(unsigned int i=0; i IfStatement::evaluate(RuleContext &context) { if(condition.evaluate(context)) { return action; } return std::nullopt; } Rule::Rule(std::vector statements) : statements(statements) {} std::optional Rule::evaluate(RuleContext &context) { for(unsigned int i=0; i