(C++)  1.0.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  struct EntityEntry
13  {
14  std::shared_ptr<AIEntity> entity;
15  int relativePriority;
16 
17  EntityEntry(const std::shared_ptr<AIEntity>& entity, int relativePriority);
18  };
19 
21  {
22  public:
23  EntityGroup(const std::string& name);
24  EntityGroup(const std::string& name, const std::vector<EntityEntry>& entityEntries);
25 
26  const std::string& GetName() const;
27 
28  void SetId(size_t id);
29  size_t GetId() const;
30 
31  void AddEntityEntry(const std::shared_ptr<AIEntity>& entity, int relativePriority);
32  void RemoveEntityEntry(const AIEntity& entity);
33  void AddGroupBlackboard(const std::string& name, const std::shared_ptr<Blackboard>& blackboard);
34 
35  const std::vector<EntityEntry>& GetEntityEntries() const;
36  const std::vector<std::pair<std::string, std::shared_ptr<Blackboard>>>& GetGroupBlackboards() const;
37  private:
38  std::string name{};
39  size_t id = std::numeric_limits<size_t>::max();
40  std::vector<EntityEntry> entityEntries{};
41  std::vector<std::pair<std::string, std::shared_ptr<Blackboard>>> groupBlackboards{};
42  };
43 }
44 
45 #endif
The AIEntity class - Defines a basic object which can execute behaviors.
Definition: AIEntity.hh:39
Definition: EntityGroup.h:21
Definition: EntityGroup.h:13