static id fixed

This commit is contained in:
Sebastian
2024-11-05 00:51:25 +01:00
parent dc7eae1931
commit 4a346350f4
3 changed files with 31 additions and 8 deletions
+4 -3
View File
@@ -9,9 +9,9 @@ namespace VISEQ::GRAPH {
class GraphItem{
public:
GraphItem() {newId();}
GraphItem() {newId(-1);}
GraphItem(const GraphItem& G) {
newId();
newId(-1);
graphItemType = G.graphItemType;
neighbors = G.neighbors;
}
@@ -20,8 +20,9 @@ namespace VISEQ::GRAPH {
int id = 0;
void newId(){
void newId(int start){
static int _id;
if(start > -1) _id = start;
id = _id;
_id++;
}