HierarchicalObject

Class in ChivalrousGames.Common

Description

This can be used to store information for nested objects. A Hierarchical object can warp around any object to allow the creation of an object hierarchy.

Properties

Parent HierarchicalObject Gets or sets the parent.
Self object ReadOnly
Gets a reference to the original object that was wrapped with the Hierarchical object.
Children ReadOnlyCollection ReadOnly
Gets the children.
Items List<ComponentValuesDictionary> ReadOnly
Gets the items on self. Used to store values on the Hierarchical object.

Constructors

Constructor
public HierarchicalObject(object self);
Parameters
self object The object instance to wrap in a Hierarchical object.
Return
HierarchicalObject Instance of HierarchicalObject
Description

Initializes a new instance of the HierarchalObject class.

Methods

AddChildren
public void AddChildren(List children);
Parameters
children List Hierarchical objects list to add as children to add to this instance.
Description

Adds children to the list. More efficient than adding each child one by one.

DetachChildren
public void DetachChildren();
Description

Detaches all the children. More efficient than removing each child one by one.