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