SimpleAI
 All Classes Namespaces Files Functions Variables Typedefs Macros Groups Pages
Classes | Public Member Functions | Protected Attributes | List of all members
ai::AIRegistry Class Reference

The place to register your TreeNode and ICondition factories at. More...

#include <AIRegistry.h>

Inheritance diagram for ai::AIRegistry:
[legend]
Collaboration diagram for ai::AIRegistry:
[legend]

Classes

class  ConditionFactory
 
class  FilterFactory
 
class  SteeringFactory
 
class  SteerNodeFactory
 
class  TreeNodeFactory
 

Public Member Functions

bool registerNodeFactory (const std::string &type, const ITreeNodeFactory &factory)
 Registers a tree node factory of the given type. More...
 
bool unregisterNodeFactory (const std::string &type)
 Unregisters a tree node factory of the given type. This can also be used to replace a built-in type with a user provided type. More...
 
bool registerSteerNodeFactory (const std::string &type, const ISteerNodeFactory &factory)
 
bool unregisterSteerNodeFactory (const std::string &type)
 Unregisters a tree node factory of the given type. This can also be used to replace a built-in type with a user provided type. More...
 
bool registerSteeringFactory (const std::string &type, const ISteeringFactory &factory)
 
bool unregisterSteeringFactory (const std::string &type)
 
bool registerFilterFactory (const std::string &type, const IFilterFactory &factory)
 
bool unregisterFilterFactory (const std::string &type)
 Unregisters a filter factory of the given type. This can also be used to replace a built-in type with a user provided type. More...
 
bool registerConditionFactory (const std::string &type, const IConditionFactory &factory)
 
bool unregisterConditionFactory (const std::string &type)
 Unregisters a condition factory of the given type. This can also be used to replace a built-in type with a user provided type. More...
 
TreeNodePtr createNode (const std::string &type, const TreeNodeFactoryContext &ctx) const override
 Allocates a new TreeNode for the given type. The type must be registered in the AIRegistry for this to work.
 
TreeNodePtr createSteerNode (const std::string &type, const SteerNodeFactoryContext &ctx) const override
 Allocates a new TreeNode for the given type. The type must be registered in the AIRegistry for this to work.
 
FilterPtr createFilter (const std::string &type, const FilterFactoryContext &ctx) const override
 Allocates a new IFilter for the given type. The type must be registered in the AIRegistry for this to work.
 
ConditionPtr createCondition (const std::string &type, const ConditionFactoryContext &ctx) const override
 Allocates a new ICondition for the given type. The type must be registered in the AIRegistry for this to work.
 
SteeringPtr createSteering (const std::string &type, const SteeringFactoryContext &ctx) const override
 Creates a new ISteering for the given type. The type must be registered in the AIRegistry for this to work.
 

Protected Attributes

TreeNodeFactory _treeNodeFactory
 
SteerNodeFactory _steerNodeFactory
 
SteeringFactory _steeringFactory
 
FilterFactory _filterFactory
 
ConditionFactory _conditionFactory
 

Detailed Description

The place to register your TreeNode and ICondition factories at.

Member Function Documentation

bool ai::AIRegistry::registerNodeFactory ( const std::string &  type,
const ITreeNodeFactory factory 
)
inline

Registers a tree node factory of the given type.

Parameters
[in]typeThe name that is used in the behaviour tree to identify nodes of the that are assigned to the given factory
[in]factoryThe factory that will create the real node.
Returns
true if the unregister action was successful, false if not (e.g. it wasn't registered at all)
bool ai::AIRegistry::unregisterConditionFactory ( const std::string &  type)
inline

Unregisters a condition factory of the given type. This can also be used to replace a built-in type with a user provided type.

Returns
true if the unregister action was successful, false if not (e.g. it wasn't registered at all)
bool ai::AIRegistry::unregisterFilterFactory ( const std::string &  type)
inline

Unregisters a filter factory of the given type. This can also be used to replace a built-in type with a user provided type.

Returns
true if the unregister action was successful, false if not (e.g. it wasn't registered at all)
bool ai::AIRegistry::unregisterNodeFactory ( const std::string &  type)
inline

Unregisters a tree node factory of the given type. This can also be used to replace a built-in type with a user provided type.

Returns
true if the unregister action was successful, false if not (e.g. it wasn't registered at all)
bool ai::AIRegistry::unregisterSteerNodeFactory ( const std::string &  type)
inline

Unregisters a tree node factory of the given type. This can also be used to replace a built-in type with a user provided type.

Returns
true if the unregister action was successful, false if not (e.g. it wasn't registered at all)

The documentation for this class was generated from the following file: