58 #define R_GET(Name) registerFactory(#Name, Name::getFactory());
59 #define R_MOVE(Name) registerFactory(#Name, movement::Name::getFactory());
101 R_MOVE(SelectionSeek);
102 R_MOVE(SelectionFlee);
168 bool registerSteerNodeFactory(
const std::string& type,
const ISteerNodeFactory& factory);
177 bool registerSteeringFactory(
const std::string& type,
const ISteeringFactory& factory);
178 bool unregisterSteeringFactory(
const std::string& type);
180 bool registerFilterFactory(
const std::string& type,
const IFilterFactory& factory);
190 bool registerConditionFactory(
const std::string& type,
const IConditionFactory& factory);
199 TreeNodePtr
createNode(
const std::string& type,
const TreeNodeFactoryContext& ctx)
const override;
200 TreeNodePtr
createSteerNode(
const std::string& type,
const SteerNodeFactoryContext& ctx)
const override;
201 FilterPtr
createFilter(
const std::string& type,
const FilterFactoryContext& ctx)
const override;
202 ConditionPtr
createCondition(
const std::string& type,
const ConditionFactoryContext& ctx)
const override;
203 SteeringPtr
createSteering(
const std::string& type,
const SteeringFactoryContext& ctx)
const override;
210 return _treeNodeFactory.create(nodeType, &ctx);
214 return _steerNodeFactory.create(nodeType, &ctx);
218 return _filterFactory.create(nodeType, &ctx);
222 return _treeNodeFactory.registerFactory(nodeType, factory);
225 inline bool AIRegistry::registerFilterFactory(
const std::string& nodeType,
const IFilterFactory& factory) {
226 return _filterFactory.registerFactory(nodeType, factory);
229 inline bool AIRegistry::registerConditionFactory(
const std::string& nodeType,
const IConditionFactory& factory) {
230 return _conditionFactory.registerFactory(nodeType, factory);
234 return _treeNodeFactory.unregisterFactory(nodeType);
237 inline bool AIRegistry::registerSteerNodeFactory(
const std::string& type,
const ISteerNodeFactory& factory) {
238 return _steerNodeFactory.registerFactory(type, factory);
242 return _steerNodeFactory.unregisterFactory(type);
245 inline bool AIRegistry::registerSteeringFactory(
const std::string& type,
const ISteeringFactory& factory) {
246 return _steeringFactory.registerFactory(type, factory);
249 inline bool AIRegistry::unregisterSteeringFactory(
const std::string& type) {
250 return _steeringFactory.unregisterFactory(type);
254 return _filterFactory.unregisterFactory(nodeType);
258 return _conditionFactory.unregisterFactory(nodeType);
262 return _conditionFactory.create(nodeType, &ctx);
266 return _steeringFactory.create(type, &ctx);
This condition will logically or all contained conditions.
Definition: Or.h:14
This condition will just swap the result of the contained condition.
Definition: Not.h:14
A node with only one child attached. The result of the attached child is inverted.
Definition: Invert.h:17
This filter just clears the selection.
Definition: SelectEmpty.h:14
This filter will just preserve the first entry of other filters.
Definition: First.h:14
This factory will create tree nodes. It uses the TreeNodeFactoryContext to collect all the needed dat...
Definition: AIFactories.h:68
Definition: AIRegistry.h:93
Definition: AIRegistry.h:66
Checks whether the controlled AI is close to a particular group.
Definition: IsCloseToGroup.h:20
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 w...
Definition: AIRegistry.h:257
This filter performs an intersection between several filter results.
Definition: Intersection.h:16
Context for ITreeNodeFactory.
Definition: AIFactories.h:15
A decorator node which limits the execution of the attached child to a specified amount of runs...
Definition: Limit.h:17
The place to register your TreeNode and ICondition factories at.
Definition: AIRegistry.h:64
This filter will just preserve the last entry of other filters.
Definition: Last.h:14
This filter will pick the entity with the highest aggro value.
Definition: SelectHighestAggro.h:14
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 w...
Definition: AIRegistry.h:233
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...
Definition: AIRegistry.h:261
Definition: AIFactories.h:51
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 t...
Definition: AIRegistry.h:213
Defines some basic movement algorithms like Wandering, Seeking and Fleeing.
This filter will pick the entities from the zone of the given entity.
Definition: SelectZone.h:15
This node tries to execute all the attached children until one succeeds. This composite only fails if...
Definition: PrioritySelector.h:17
ITimedNode that is just idling until the given time is elapsed.
Definition: Idle.h:13
Definition: AIFactories.h:43
A decorator node with only one child attached. The result of the attached child is only taken into ac...
Definition: Fail.h:15
Checks whether the AI is in any or in a particular group.
Definition: IsInGroup.h:22
This node executes one of the attached children randomly based on the given weights. The node is executed until it is no longer in the running state.
Definition: ProbabilitySelector.h:20
A decorator node with only one child attached. The result of the attached child is only taken into ac...
Definition: Succeed.h:16
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 t...
Definition: AIRegistry.h:209
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...
Definition: AIRegistry.h:265
Definition: AIFactories.h:24
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...
Definition: AIRegistry.h:217
This filter will preserve only a few random entries.
Definition: Random.h:15
Definition: AIFactories.h:89
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...
Definition: AIRegistry.h:253
Definition: AIFactories.h:82
This condition just always evaluates to false.
Definition: False.h:14
Definition: AIFactories.h:34
Evaluates to true if you are the first member in a particular group.
Definition: IsGroupLeader.h:19
Definition: IAIFactory.h:39
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 w...
Definition: AIRegistry.h:241
The sequence continues to execute their children until one of the children returned a state that is n...
Definition: Sequence.h:19
This filter will pick the entities from the groups the given AI instance is in.
Definition: SelectGroupMembers.h:15
Definition: AIRegistry.h:129
Definition: AIRegistry.h:84
This filter is a nop - it will just use the already filtered entities.
Definition: SelectAll.h:14
Definition: AIFactories.h:75
Definition: IFactoryRegistry.h:21
This filter merges several other filter results.
Definition: Union.h:16
bool registerNodeFactory(const std::string &type, const ITreeNodeFactory &factory)
Registers a tree node factory of the given type.
Definition: AIRegistry.h:221
This filter performs a complement operation on already filtered entities with the results given by th...
Definition: Complement.h:17
Definition: AIRegistry.h:108
The filter condition executes some selection filters (IFilter) and evaluates to true if the resulting...
Definition: Filter.h:20
This node executes all the attached children in random order. This composite only fails if all childr...
Definition: RandomSelector.h:18
This condition just always evaluates to true.
Definition: True.h:14
This condition will logically and all contained conditions.
Definition: And.h:14
This filter performs a difference operation between several filter results. The result consists of el...
Definition: Difference.h:17
This filter will pick the group leader of the specified group.
Definition: SelectGroupLeader.h:15
Executes all the connected children in the order they were added (no matter what the TreeNodeStatus o...
Definition: Parallel.h:17
This condition checks whether there are enemies.
Definition: HasEnemies.h:21