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

Implement unlimited depth.

parent 22ad5962
Branches
Tags
No related merge requests found
......@@ -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.
Please register or to comment