27 explicit HasEnemies(
const std::string& parameters) :
29 if (_parameters.empty()) {
32 _enemyCount = std::stoi(_parameters);
37 const AggroMgr& mgr = entity->getAggroMgr();
38 if (_enemyCount == -1) {
43 const int size =
static_cast<int>(mgr.
getEntries().size());
44 return size >= _enemyCount;
Manages the aggro values for one AI instance. There are several ways to degrade the aggro values...
Definition: AggroMgr.h:21
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
const Entries & getEntries() const
Definition: AggroMgr.h:176
EntryPtr getHighestEntry() const
Get the entry with the highest aggro value.
Definition: AggroMgr.h:185
bool evaluate(const AIPtr &entity) override
Checks whether the condition evaluates to true for the given entity.
Definition: HasEnemies.h:36
#define CONDITION_FACTORY(ConditionName)
A condition factory macro to ease and unify the registration at AIRegistry.
Definition: ICondition.h:55
This condition checks whether there are enemies.
Definition: HasEnemies.h:21