| 777 | } |
| 778 | |
| 779 | nlohmann::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 | |
| 794 | void ImportTreeFromJSON(const nlohmann::json& json, Tree& tree) |
| 795 | { |
no test coverage detected