Skip to content
Snippets Groups Projects
Commit 06b42396 authored by Hock, Martin's avatar Hock, Martin
Browse files

Implement unlimited depth.

parent 22ad5962
No related branches found
No related tags found
1 merge request!3Merge to main to create "WS2223" Version
Pipeline #929470 failed
......@@ -158,7 +158,7 @@ class LegoAssembly:
def get_component_list(self, max_depth: int = -1) -> List[LegoComponent]:
component_list = []
component_list.extend(self.components)
if max_depth > 0:
if max_depth > 0 or max_depth < 0:
for assembly in self.assemblies:
component_list.extend(assembly.get_component_list(max_depth - 1))
return component_list
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment