Content browser

This commit is contained in:
Simon Lübeß
2022-07-25 17:03:28 +02:00
parent 0339ae4422
commit bff4418b84
21 changed files with 481 additions and 44 deletions
+22
View File
@@ -45,4 +45,26 @@ namespace GlitchyEngine.Collections
return null;
}
}
static
{
public static mixin DeleteTreeAndChildren<T>(TreeNode<T> tree) where T : class, delete
{
InternalDeleteTreeAndChildren(tree);
}
private static void InternalDeleteTreeAndChildren<T>(TreeNode<T> tree) where T : class, delete
{
for (var child in tree.Children)
{
InternalDeleteTreeAndChildren(child);
}
delete tree.Value;
tree.Children.Clear();
delete tree;
}
}
}