22 IFilter(
"SelectGroupLeader", parameters) {
23 if (_parameters.empty()) {
26 _groupId = std::stoi(_parameters);
30 void filter (
const AIPtr& entity)
override {
31 FilteredEntities& entities = getFilteredEntities(entity);
32 const Zone* zone = entity->getZone();
33 const GroupMgr& groupMgr = zone->getGroupMgr();
34 const AIPtr& groupLeader = groupMgr.
getLeader(_groupId);
36 entities.push_back(groupLeader->getId());
Maintains the groups a AI can be in.
Definition: GroupMgr.h:27
AIPtr getLeader(GroupId id) const
Definition: GroupMgr.h:248
This filter will pick the group leader of the specified group.
Definition: SelectGroupLeader.h:15