json is loading, but does nothing yet

This commit is contained in:
Sebastian
2024-11-03 03:48:49 +01:00
parent a4ea20b2b3
commit 7bdd68bdcc
16 changed files with 1174 additions and 1104 deletions
+26 -33
View File
@@ -3,51 +3,44 @@
#include <memory>
#include <raylib.h>
#include "nlohmann/json.hpp"
#include "datatypes.h"
#include "graph-item.h"
#include "moveable.h"
class Edge;
namespace VISEQ::GRAPH::EDGES{
class Edge;
}
typedef std::shared_ptr<Edge> SPTR_Edge;
typedef std::vector<SPTR_Edge> VEC_SPTR_Edge;
namespace VISEQ::GRAPH::NODES {
class Node : public Movable, public GraphItem{
class Node : public BASE::Movable, public GraphItem{
public:
Node() {}
Node(float x, float y) : Movable(Vec2Df(x, y), 0.0f) {}
Node(Vec2Df p) : Movable(p, 0.0f) {}
public:
Node() {}
Node(float x, float y) : Movable(Vec2Df(x, y), 0.0f) {}
Node(Vec2Df p) : Movable(p, 0.0f) {}
NodeType nodeType;
NodeType nodeType;
std::shared_ptr<Node> neighbor;
VEC_SPTR_Edge connections;
std::shared_ptr<Node> neighbor;
std::vector<std::shared_ptr<VISEQ::GRAPH::EDGES::Edge>> connections;
Distribution distributionMode = Distribution::GEOMETRIC;
Distribution distributionMode = Distribution::GEOMETRIC;
float radius = 15.0f;
bool config = false;
float radius = 15.0f;
bool config = false;
virtual NodeType getNodeType() {return nodeType;}
virtual NodeType getNodeType() const {return nodeType;}
virtual void SMode(int mode) {};
virtual int GGate() {return 0;};
virtual int GActive() {return 0;};
virtual void trigger() {};
void draw(Vec2Df mouse_pos, Camera2D cam) override {}
};
virtual void SMode(int mode) {};
virtual int GGate() {return 0;};
virtual int GActive() {return 0;};
virtual void trigger() {};
void draw(Vec2Df mouse_pos, Camera2D cam) override {}
};
typedef std::shared_ptr<Node> SPTR_Node;
typedef std::vector<SPTR_Node> VEC_SPTR_Node;
typedef std::shared_ptr<VISEQ::GRAPH::NODES::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}};*/
/*}*/
//NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Node, nodeType, neighbor, connections, distributionMode)
//NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Node, id, nodeType, distributionMode)
}