mirror of
https://github.com/Findus23/RPGnotes.git
synced 2024-09-19 15:43:45 +02:00
don't add edges to itself
This commit is contained in:
parent
2c6a79edf5
commit
1e940660d3
1 changed files with 4 additions and 0 deletions
|
@ -32,9 +32,13 @@ class Graph:
|
|||
})
|
||||
|
||||
def add_edge(self, source: GraphModelEl, target: GraphModelEl):
|
||||
if source == target:
|
||||
return
|
||||
self.edges.add((source.graphkey, target.graphkey))
|
||||
|
||||
def add_edge_str(self, source: str, target: str):
|
||||
if source == target:
|
||||
return
|
||||
self.edges.add((source, target))
|
||||
|
||||
def prune(self) -> None:
|
||||
|
|
Loading…
Reference in a new issue