diff --git a/docs/tutorial_05_subtrees.md b/docs/tutorial_05_subtrees.md index bc745e33b..32c849dd7 100644 --- a/docs/tutorial_05_subtrees.md +++ b/docs/tutorial_05_subtrees.md @@ -44,7 +44,14 @@ It is also the first practical example that uses `Decorators` and `Fallback`. ``` -It may be noticed that we incapsulated a quite complex branch of the tree, +For readability, our custom nodes are registered with the one-liner: + +`CrossDoor::RegisterNodes(factory);` + +Default nodes provided by the BT library such as `Fallback` are already registered by +the BehaviorTreeFactory. + +It may be noticed that we encapsulated a quite complex branch of the tree, the one to execute when the door is closed, into a separate tree called `DoorClosed`. diff --git a/examples/t05_crossdoor.cpp b/examples/t05_crossdoor.cpp index 033e7ef3b..be9272c7d 100644 --- a/examples/t05_crossdoor.cpp +++ b/examples/t05_crossdoor.cpp @@ -61,7 +61,9 @@ int main(int argc, char** argv) { BT::BehaviorTreeFactory factory; - // register all the actions into the factory + // Register our custom nodes into the factory. + // Any default nodes provided by the BT library (such as Fallback) are registered by + // default in the BehaviorTreeFactory. CrossDoor::RegisterNodes(factory); // Important: when the object tree goes out of scope, all the TreeNodes are destroyed