MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.CPP / ImportTreeFromJSON

Function ImportTreeFromJSON

src/bt_factory.cpp:794–807  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

792}
793
794void ImportTreeFromJSON(const nlohmann::json& json, Tree& tree)
795{
796 if(json.size() != tree.subtrees.size())
797 {
798 throw std::runtime_error("Number of blackboards don't match:");
799 }
800
801 size_t index = 0;
802 for(const auto& [key, array] : json.items())
803 {
804 auto& subtree = tree.subtrees.at(index++);
805 ImportBlackboardFromJSON(array, *subtree->blackboard);
806 }
807}
808
809} // namespace BT

Callers 1

mainFunction · 0.85

Calls 2

ImportBlackboardFromJSONFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected