TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ SaveInternal()

nlohmann::json NodeEditorNode::SaveInternal ( )

Definition at line 266 of file NodeEditor.cpp.

267{
268 nlohmann::json data = Save();
269 data["name"] = name;
270 data["headerColor"] = headerColor;
271 data["id"] = id;
272 nlohmann::json tmp, tmp2;
273
274 for (int i = 0; i < inputPins.size(); i++)
275 {
276 tmp2 = inputPins[i]->Save();
277 tmp2["index"] = i;
278 tmp.push_back(tmp2);
279 }
280
281 data["inputPins"] = tmp;
282 tmp.clear();
283
284 for (int i = 0; i < outputPins.size(); i++)
285 {
286 tmp2 = outputPins[i]->Save();
287 tmp2["index"] = i;
288 tmp.push_back(tmp2);
289 }
290
291 data["posX"] = nodePosition.x;
292 data["posY"] = nodePosition.y;
293 data["outputPins"] = tmp;
294 return data;
295}
void clear() noexcept
clears the contents
Definition: json.hpp:23069
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