16 ConditionPtr _condition;
19 s <<
"(" << _condition->getNameWithConditions(entity) <<
")";
25 explicit
Not(const ConditionPtr& condition) :
32 return !_condition->evaluate(entity);
36 inline ConditionPtr Not::Factory::create(
const ConditionFactoryContext *ctx)
const {
37 if (ctx->conditions.size() != 1) {
38 return ConditionPtr();
40 return std::make_shared<Not>(ctx->conditions.front());
This condition will just swap the result of the contained condition.
Definition: Not.h:14
bool evaluate(const AIPtr &entity) override
Checks whether the condition evaluates to true for the given entity.
Definition: Not.h:31
A condition can be placed on a TreeNode to decide which node is going to get executed. In general they are stateless. If they are not, it should explicitly get noted.
Definition: ICondition.h:124
#define CONDITION_FACTORY_NO_IMPL(ConditionName)
A condition factory macro to ease and unify the registration at AIRegistry. You still have to impleme...
Definition: ICondition.h:41
void getConditionNameWithValue(std::stringstream &s, const AIPtr &entity) override
Override this method to get a more detailed result in getNameWithConditions()
Definition: Not.h:18