static id fixed
This commit is contained in:
+4
-3
@@ -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++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user