Skip to content

Commit 6e2cc03

Browse files
authored
Small comments on node registration (#399)
1 parent 4fa2177 commit 6e2cc03

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

docs/tutorial_05_subtrees.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,14 @@ It is also the first practical example that uses `Decorators` and `Fallback`.
4444
</root>
4545
```
4646

47-
It may be noticed that we incapsulated a quite complex branch of the tree,
47+
For readability, our custom nodes are registered with the one-liner:
48+
49+
`CrossDoor::RegisterNodes(factory);`
50+
51+
Default nodes provided by the BT library such as `Fallback` are already registered by
52+
the BehaviorTreeFactory.
53+
54+
It may be noticed that we encapsulated a quite complex branch of the tree,
4855
the one to execute when the door is closed, into a separate tree called
4956
`DoorClosed`.
5057

examples/t05_crossdoor.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ int main(int argc, char** argv)
6161
{
6262
BT::BehaviorTreeFactory factory;
6363

64-
// register all the actions into the factory
64+
// Register our custom nodes into the factory.
65+
// Any default nodes provided by the BT library (such as Fallback) are registered by
66+
// default in the BehaviorTreeFactory.
6567
CrossDoor::RegisterNodes(factory);
6668

6769
// Important: when the object tree goes out of scope, all the TreeNodes are destroyed

0 commit comments

Comments
 (0)