json serialization beginnings, but still much to do
This commit is contained in:
+10
-2
@@ -8,11 +8,19 @@
|
||||
class GraphItem{
|
||||
|
||||
public:
|
||||
GraphItem() {static int _id; id=_id++;}
|
||||
std::vector<std::shared_ptr<GraphItem>> neighbors;
|
||||
|
||||
int id = 0;
|
||||
GraphItemType graphItemType;
|
||||
|
||||
virtual void draw(Vec2D<float> mouse, Camera2D cam) = 0;
|
||||
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}};*/
|
||||
/*}*/
|
||||
|
||||
};
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(GraphItem, id, graphItemType, neighbors)
|
||||
|
||||
Reference in New Issue
Block a user