We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd8e066 commit 3e44155Copy full SHA for 3e44155
pathfinding3d/core/node.py
@@ -101,7 +101,7 @@ class GridNode(Node):
101
# Set it to None if you only have one grid.
102
grid_id: Optional[int] = None
103
104
- connections: Optional[List] = None
+ connections: List["GridNode"] = dataclasses.field(default_factory=list)
105
106
def __post_init__(self):
107
super().__init__()
@@ -126,7 +126,4 @@ def connect(self, other_node: "GridNode"):
126
other_node : GridNode
127
The node to connect to.
128
"""
129
- if not self.connections:
130
- self.connections = [other_node]
131
- else:
132
- self.connections.append(other_node)
+ self.connections.append(other_node)
0 commit comments