22 IFilter(
"SelectGroupMembers", parameters) {
23 if (_parameters.empty()) {
26 _groupId = std::stoi(_parameters);
30 void filter (
const AIPtr& entity)
override {
31 FilteredEntities& entities = getFilteredEntities(entity);
32 auto func = [&] (
const AIPtr& ai) {
33 entities.push_back(ai->getId());
36 Zone* zone = entity->getZone();
37 GroupMgr& groupMgr = zone->getGroupMgr();
38 groupMgr.
visit(_groupId, func);
Maintains the groups a AI can be in.
Definition: GroupMgr.h:27
This filter will pick the entities from the groups the given AI instance is in.
Definition: SelectGroupMembers.h:15
void visit(GroupId id, Func &func) const
Visit all the group members of the given group until the functor returns false.
Definition: GroupMgr.h:126