TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ Save()

nlohmann::json NodeEditor::Save ( )

Definition at line 310 of file NodeEditor.cpp.

311{
312 nlohmann::json data;
313 data["type"] = "NodeEditorData";
314 data["serializer"] = "Node Serializer v2.0";
315 nlohmann::json tmp;
316
317 for (auto &it : nodes)
318 {
319 if(it.second->name != "Output")
320 {
321 tmp.push_back(it.second->SaveInternal());
322 }
323 }
324
325 data["nodes"] = tmp;
326 tmp = nlohmann::json();
327
328 for (auto &it : links)
329 {
330 tmp.push_back(it.second->Save());
331 }
332
333 data["links"] = tmp;
334 data["uidSeed"] = GenerateUID();
335 return data;
336}
void push_back(basic_json &&val)
add an object to an array
Definition: json.hpp:23148
a class to store JSON values
Definition: json.hpp:17860
basic_json<> json
default JSON class
Definition: json.hpp:3411