(C++)  1.0.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  virtual ~Domain() = default;
23 
24  Domain& operator = (const Domain&) = delete;
25 
30  ActionTemplate& AddActionTemplate(const std::string& name, const std::vector<std::string>& paramNames);
31 
33  WorldObject CreateObjectOfType(const std::string& name) const;
34 
36  unsigned int GetTypeIndex(const std::string& typeName) const;
37 
38  std::vector<std::string> objectTypes{};
39  std::vector<WorldObjectType> types{};
40  std::map<std::string, unsigned int> typemap{};
41  std::vector<ActionTemplate> actionTemplates{};
42  };
43  }
44 }
45 #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:74
WorldObject CreateObjectOfType(const std::string &name) const
Creates and object of a type identified by name parameter.
Definition: Domain.cpp:69