(C++)  1.1.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
Domain.hh
1 #ifndef GRAIL_DOMAIN_H
2 #define GRAIL_DOMAIN_H
3 
4 #include "Action/ActionTemplate.hh"
5 #include "WorldState/WorldObjectType.hh"
6 #include "WorldState/WorldObject.hh"
7 
8 #include <unordered_map>
9 #include <vector>
10 #include <string>
11 
12 namespace grail
13 {
14  namespace planning
15  {
16  struct Domain
17  {
19  Domain(const std::vector<WorldObjectType>& types);
20  Domain(const Domain& other) = delete;
21 
22  //REVIEW: consider adding move constructor and move assignment for the rule of 5
23  virtual ~Domain() = default;
24 
25  Domain& operator = (const Domain&) = delete;
26 
31  ActionTemplate& AddActionTemplate(const std::string& name, const std::vector<std::string>& paramNames);
32 
34  WorldObject CreateObjectOfType(const std::string& name) const;
35 
37  unsigned int GetTypeIndex(const std::string& typeName) const;
38 
39  std::vector<std::string> objectTypes{};
40  std::vector<WorldObjectType> types{};
41  std::map<std::string, unsigned int> typemap{};
42  std::vector<ActionTemplate> actionTemplates{};
43  };
44  }
45 }
46 #endif //GRAIL_PLAN_DOMAIN_H
A class representing an action that can be simulated by grail planner.
Definition: ActionTemplate.hh:21
Definition: WorldObject.hh:14
Definition: Domain.hh:17
Domain(const std::vector< WorldObjectType > &types)
Definition: Domain.cpp:10
ActionTemplate & AddActionTemplate(const std::string &name, const std::vector< std::string > &paramNames)
Definition: Domain.cpp:58
unsigned int GetTypeIndex(const std::string &typeName) const
Definition: Domain.cpp:75
WorldObject CreateObjectOfType(const std::string &name) const
Creates and object of a type identified by name parameter.
Definition: Domain.cpp:70