From 06b423965d2b3412cc9443d45a2e4b8d045d6293 Mon Sep 17 00:00:00 2001 From: "Hock, Martin" <martin.hock@fst.tu-darmstadt.de> Date: Thu, 2 Mar 2023 18:51:58 +0100 Subject: [PATCH] Implement unlimited depth. --- functions/classes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/classes.py b/functions/classes.py index d5854b8..758fbb1 100644 --- a/functions/classes.py +++ b/functions/classes.py @@ -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 -- GitLab