HierarchyEntity2D Children Property Delta Engine Documentation

Namespace: DeltaEngine.Rendering2D
Assembly: DeltaEngine.Rendering2D (in DeltaEngine.Rendering2D.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public List<HierarchyObject2D> Children { get; }

Property Value

Type: List HierarchyObject2D 

Implements

HierarchyObject2D Children
Remarks

Tests: DeltaEngine.Rendering2D.Tests.HierarchyEntity2DTests
Examples

2 unit tests call DeltaEngine.Rendering2D.HierarchyEntity2D.Children
[Test]
public void NoChildrenGivesNullWhenSearching()
{
    var parentEntity = new MockHierarchyEntity2D();
    Assert.IsNull(parentEntity.GetFirstChildOfType<MockHierarchyEntity2D>());
}
[Test]
public void SetActiveAlsoSetsForChildren()
{
    var parentEntity = new MockHierarchyEntity2D();
    var childEntity = new MockHierarchyEntity2D();
    parentEntity.Add(childEntity);
    parentEntity.IsActive = false;
    Assert.AreEqual(parentEntity.IsActive, childEntity.IsActive);
}
See Also