@@ -35,17 +35,22 @@ class XMLParser
3535 const BehaviorTreeFactory& factory_;
3636};
3737
38+ struct Tree
39+ {
40+ TreeNode* root_node;
41+ std::vector<TreeNode::Ptr> nodes;
42+ };
43+
3844/* * Helper function to do the most common steps all at once:
3945* 1) Create an instance of XMLParse and call loadFromText.
4046* 2) Instantiate the entire tree.
4147* 3) Assign the given Blackboard
4248*
4349* return: a pair containing the root node (first) and a vector with all the instantiated nodes (second).
4450*/
45- std::pair<TreeNode::Ptr, std::vector<TreeNode::Ptr>>
46- buildTreeFromText (const BehaviorTreeFactory& factory,
47- const std::string& text,
48- const Blackboard::Ptr& blackboard = Blackboard::Ptr() );
51+ Tree buildTreeFromText (const BehaviorTreeFactory& factory,
52+ const std::string& text,
53+ const Blackboard::Ptr& blackboard = Blackboard::Ptr() );
4954
5055/* * Helper function to do the most common steps all at once:
5156* 1) Create an instance of XMLParse and call loadFromFile.
@@ -54,10 +59,9 @@ buildTreeFromText(const BehaviorTreeFactory& factory,
5459*
5560* return: a pair containing the root node (first) and a vector with all the instantiated nodes (second).
5661*/
57- std::pair<TreeNode::Ptr, std::vector<TreeNode::Ptr>>
58- buildTreeFromFile (const BehaviorTreeFactory& factory,
59- const std::string& filename,
60- const Blackboard::Ptr& blackboard = Blackboard::Ptr() );
62+ Tree buildTreeFromFile (const BehaviorTreeFactory& factory,
63+ const std::string& filename,
64+ const Blackboard::Ptr& blackboard = Blackboard::Ptr() );
6165
6266std::string writeXML (const BehaviorTreeFactory& factory,
6367 const TreeNode* root_node,
0 commit comments