| 335 | } |
| 336 | |
| 337 | nlohmann::json ExportBlackboardToJSON(const Blackboard& blackboard) |
| 338 | { |
| 339 | nlohmann::json dest; |
| 340 | for(auto entry_name : blackboard.getKeys()) |
| 341 | { |
| 342 | const std::string name(entry_name); |
| 343 | if(auto any_ref = blackboard.getAnyLocked(name)) |
| 344 | { |
| 345 | if(auto any_ptr = any_ref.get()) |
| 346 | { |
| 347 | JsonExporter::get().toJson(*any_ptr, dest[name]); |
| 348 | } |
| 349 | } |
| 350 | } |
| 351 | return dest; |
| 352 | } |
| 353 | |
| 354 | void ImportBlackboardFromJSON(const nlohmann::json& json, Blackboard& blackboard) |
| 355 | { |