SimpleAI
 All Classes Namespaces Files Functions Variables Typedefs Macros Groups Pages
SelectZone.h
Go to the documentation of this file.
1 
5 #pragma once
6 
7 #include "filter/IFilter.h"
8 #include "zone/Zone.h"
9 
10 namespace ai {
11 
15 class SelectZone: public IFilter {
16 public:
17  FILTER_FACTORY(SelectZone)
18 
19  explicit SelectZone(const std::string& parameters = "") :
20  IFilter("SelectZone", parameters) {
21  }
22 
23  void filter (const AIPtr& entity) override {
24  FilteredEntities& entities = getFilteredEntities(entity);
25  auto func = [&] (const AIPtr& ai) {
26  entities.push_back(ai->getId());
27  return true;
28  };
29  entity->getZone()->execute(func);
30  }
31 };
32 
33 }
This filter will pick the entities from the zone of the given entity.
Definition: SelectZone.h:15