SimpleAI
 All Classes Namespaces Files Functions Variables Typedefs Macros Groups Pages
IAIFactory.h
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #include <memory>
7 #include <string>
8 #include <vector>
9 #include <list>
10 
11 namespace ai {
12 
13 class TreeNode;
14 typedef std::shared_ptr<TreeNode> TreeNodePtr;
15 typedef std::vector<TreeNodePtr> TreeNodes;
16 
17 class IFilter;
18 typedef std::shared_ptr<IFilter> FilterPtr;
19 typedef std::list<FilterPtr> Filters;
20 
21 namespace movement {
22 class ISteering;
23 }
24 typedef std::shared_ptr<movement::ISteering> SteeringPtr;
25 namespace movement {
26 typedef std::vector<SteeringPtr> Steerings;
27 }
28 
29 class ICondition;
30 typedef std::shared_ptr<ICondition> ConditionPtr;
31 typedef std::vector<ConditionPtr> Conditions;
32 
33 struct TreeNodeFactoryContext;
34 struct ConditionFactoryContext;
35 struct FilterFactoryContext;
36 struct SteerNodeFactoryContext;
37 struct SteeringFactoryContext;
38 
39 class IAIFactory {
40 public:
41  virtual ~IAIFactory() {
42  }
43 
47  virtual TreeNodePtr createNode(const std::string& type, const TreeNodeFactoryContext& ctx) const = 0;
51  virtual TreeNodePtr createSteerNode(const std::string& type, const SteerNodeFactoryContext& ctx) const = 0;
55  virtual FilterPtr createFilter(const std::string& type, const FilterFactoryContext& ctx) const = 0;
59  virtual ConditionPtr createCondition(const std::string& type, const ConditionFactoryContext& ctx) const = 0;
63  virtual SteeringPtr createSteering(const std::string& type, const SteeringFactoryContext& ctx) const = 0;
64 };
65 
66 }
virtual ConditionPtr createCondition(const std::string &type, const ConditionFactoryContext &ctx) const =0
Allocates a new ICondition for the given type. The type must be registered in the AIRegistry for this...
Context for ITreeNodeFactory.
Definition: AIFactories.h:15
Definition: AIFactories.h:51
Definition: AIFactories.h:43
Definition: AIFactories.h:24
virtual SteeringPtr createSteering(const std::string &type, const SteeringFactoryContext &ctx) const =0
Creates a new ISteering for the given type. The type must be registered in the AIRegistry for this to...
virtual FilterPtr createFilter(const std::string &type, const FilterFactoryContext &ctx) const =0
Allocates a new IFilter for the given type. The type must be registered in the AIRegistry for this to...
Definition: AIFactories.h:34
Definition: IAIFactory.h:39
virtual TreeNodePtr createNode(const std::string &type, const TreeNodeFactoryContext &ctx) const =0
Allocates a new TreeNode for the given type. The type must be registered in the AIRegistry for this t...
virtual TreeNodePtr createSteerNode(const std::string &type, const SteerNodeFactoryContext &ctx) const =0
Allocates a new TreeNode for the given type. The type must be registered in the AIRegistry for this t...