Added node creation by left-click, node drawing and first part of node creator panel drawing

This commit is contained in:
2024-06-30 20:27:24 +02:00
parent 9870a643dd
commit d1bcdcd530
3 changed files with 45 additions and 6 deletions

View File

@ -10,7 +10,7 @@ class Graph:
self.nodes: list[Node] = []
def add_node(self, x: int, y: int) -> None:
self.nodes.append(Node(x, y))
self.nodes.append(Node(x, y, "NO NAME"))
def add_edge(self, start_index: int, end_index: int, length: float) -> None:
self.edges.append(Edge(start_index, end_index, length))

View File

@ -1,4 +1,5 @@
class Node:
def __init__(self, x: int, y: int):
def __init__(self, x: int, z: int, name: str):
self.x: int = x
self.y: int = y
self.z: int = z
self.name: str = name