chore: SetHierarchyObject parent parameter added
This commit is contained in:
parent
b94bbc8ed7
commit
3a385900fb
@ -7,9 +7,12 @@ namespace Syntriax.Engine.Core;
|
|||||||
|
|
||||||
public static class HierarchyObjectExtensions
|
public static class HierarchyObjectExtensions
|
||||||
{
|
{
|
||||||
public static T SetHierarchyObject<T>(this T hierarchyObject, string name) where T : IHierarchyObject
|
public static T SetHierarchyObject<T>(this T hierarchyObject, string? name = "", IHierarchyObject? parent = null) where T : IHierarchyObject
|
||||||
{
|
{
|
||||||
hierarchyObject.Name = name;
|
if (!string.IsNullOrWhiteSpace(name))
|
||||||
|
hierarchyObject.Name = name;
|
||||||
|
if (parent is not null)
|
||||||
|
hierarchyObject.SetParent(parent);
|
||||||
return hierarchyObject;
|
return hierarchyObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user