Files
viseq/src/graph-item.h
T

27 lines
629 B
C++
Raw Normal View History

2024-10-30 14:55:24 +01:00
#pragma once
#include "raylib.h"
2024-10-30 14:55:24 +01:00
#include "datatypes.h"
#include <memory>
2024-10-30 14:55:24 +01:00
#include <vector>
class GraphItem{
public:
GraphItem() {static int _id; id=_id++;}
std::vector<std::shared_ptr<GraphItem>> neighbors;
int id = 0;
GraphItemType graphItemType;
virtual void draw(Vec2Df mouse, Camera2D cam) {};
virtual GraphItemType getType() {return graphItemType;}
virtual ~GraphItem() = default;
/*void to_json(json& j, const GraphItem& G){*/
/* j = json{{"id",id},{"graphItemType",graphItemType},{"neighbors",neighbors}};*/
/*}*/
2024-10-30 14:55:24 +01:00
};
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(GraphItem, id, graphItemType, neighbors)