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

Function ExportTreeToJSON

src/bt_factory.cpp:779–792  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

777}
778
779nlohmann::json ExportTreeToJSON(const Tree& tree)
780{
781 nlohmann::json out;
782 for(const auto& subtree : tree.subtrees)
783 {
784 auto sub_name = subtree->instance_name;
785 if(sub_name.empty())
786 {
787 sub_name = subtree->tree_ID;
788 }
789 out[sub_name] = ExportBlackboardToJSON(*subtree->blackboard);
790 }
791 return out;
792}
793
794void ImportTreeFromJSON(const nlohmann::json& json, Tree& tree)
795{

Callers 1

mainFunction · 0.85

Calls 2

ExportBlackboardToJSONFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected