SimpleAI
 All Classes Namespaces Files Functions Variables Typedefs Macros Groups Pages
SelectHighestAggro.h
Go to the documentation of this file.
1 
5 #pragma once
6 
7 #include "filter/IFilter.h"
8 
9 namespace ai {
10 
14 class SelectHighestAggro: public IFilter {
15 public:
16  FILTER_CLASS_SINGLETON(SelectHighestAggro)
17 
18  void filter (const AIPtr& entity) override;
19 };
20 
21 inline void SelectHighestAggro::filter (const AIPtr& entity) {
22  const EntryPtr entry = entity->getAggroMgr().getHighestEntry();
23  if (!entry)
24  return;
25 
26  const CharacterId id = entry->getCharacterId();
27  getFilteredEntities(entity).push_back(id);
28 }
29 
30 }
This filter will pick the entity with the highest aggro value.
Definition: SelectHighestAggro.h:14
One entry for the AggroMgr.
Definition: Entry.h:17