still in the middle of json export, last attempt did not work

This commit is contained in:
Sebastian
2024-11-02 23:12:38 +01:00
parent 522e9d456a
commit a4ea20b2b3
11 changed files with 158 additions and 68 deletions
+11 -1
View File
@@ -1,5 +1,6 @@
#pragma once
#include <memory>
#include <raylib.h>
#include "nlohmann/json.hpp"
@@ -8,6 +9,11 @@
#include "graph-item.h"
#include "moveable.h"
class Edge;
typedef std::shared_ptr<Edge> SPTR_Edge;
typedef std::vector<SPTR_Edge> VEC_SPTR_Edge;
class Node : public Movable, public GraphItem{
public:
@@ -17,7 +23,7 @@ class Node : public Movable, public GraphItem{
NodeType nodeType;
SPTR_Node neighbor;
std::shared_ptr<Node> neighbor;
VEC_SPTR_Edge connections;
@@ -35,6 +41,10 @@ class Node : public Movable, public GraphItem{
void draw(Vec2Df mouse_pos, Camera2D cam) override {}
};
typedef std::shared_ptr<Node> SPTR_Node;
typedef std::vector<SPTR_Node> VEC_SPTR_Node;
/*inline void to_json(json& j, const std::shared_ptr<Node>& N){*/
/* j = json{{"id", N->id}, {"nodeType",N->nodeType}};*/
/*}*/