(C++)  1.1.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
EntityGroup.h
1 #ifndef GRAIL_ENTITY_GROUP_H
2 #define GRAIL_ENTITY_GROUP_H
3 
4 #include "Blackboard.hh"
5 #include "AIEntity.hh"
6 
7 #include <string>
8 #include <vector>
9 
10 namespace grail
11 {
12  //REVIEW: this is an internal struct, but consider at least dox comment for us about its purpose
13  struct EntityEntry
14  {
15  std::shared_ptr<AIEntity> entity;
16  int relativePriority;
17 
18  EntityEntry(const std::shared_ptr<AIEntity>& entity, int relativePriority);
19  };
20 
22  {
23  public:
24  EntityGroup(const std::string& name);
25  EntityGroup(const std::string& name, const std::vector<EntityEntry>& entityEntries);
26 
27  const std::string& GetName() const;
28 
29  void SetId(size_t id);
30  size_t GetId() const;
31 
32  void AddEntityEntry(const std::shared_ptr<AIEntity>& entity, int relativePriority);
33  void RemoveEntityEntry(const AIEntity& entity);
34  void AddGroupBlackboard(const std::string& name, const std::shared_ptr<Blackboard>& blackboard);
35 
36  const std::vector<EntityEntry>& GetEntityEntries() const;
37  const std::vector<std::pair<std::string, std::shared_ptr<Blackboard>>>& GetGroupBlackboards() const;
38  private:
39  std::string name{};
40  size_t id = std::numeric_limits<size_t>::max();
41  std::vector<EntityEntry> entityEntries{};
42  std::vector<std::pair<std::string, std::shared_ptr<Blackboard>>> groupBlackboards{};
43  };
44 }
45 
46 #endif
The AIEntity class - Defines a basic object which can execute behaviors.
Definition: AIEntity.hh:39
Definition: EntityGroup.h:22
Definition: EntityGroup.h:14