Class EcsContainer<Tchild>
public class EcsContainer<Tchild> : EcsContainer, IDisposable, IEnumerable<EcsNode>, IEnumerable where Tchild : EcsNode
Type Parameters
Tchild
- Inheritance
-
EcsContainer<Tchild>
- Implements
- Derived
- Inherited Members
Constructors
EcsContainer()
public EcsContainer()
Properties
ChildrenById
public IReadOnlyDictionary<Guid, Tchild> ChildrenById { get; }
Property Value
- IReadOnlyDictionary<Guid, Tchild>
ChildrenByName
public IReadOnlyDictionary<string, Tchild> ChildrenByName { get; }
Property Value
- IReadOnlyDictionary<string, Tchild>
ChildrenCount
The number of immediate childrenList.
public override int ChildrenCount { get; }
Property Value
this[string]
Get child by name.
public Tchild this[string path] { get; }
Parameters
path
string
Property Value
- Tchild
Exceptions
- KeyNotFoundException
Entity does not exist.
Methods
Adopt(EcsNode)
public override void Adopt(EcsNode child)
Parameters
child
EcsNode
Adopt(Tchild)
Adopt an entity, making this its parent.
public void Adopt(Tchild child)
Parameters
child
TchildThe entity to adopt.
Disown(EcsNode)
public override void Disown(EcsNode child)
Parameters
child
EcsNode
Disown(Tchild)
Disown an entity, destroying it and its childrenList.
public bool Disown(Tchild entity)
Parameters
entity
TchildThe entity to disown.
Returns
- bool
True if the entity was parented by this node.
Find(string)
Find child by query.
public IEnumerable<Tchild> Find(string query)
Parameters
query
stringThe query string.
Returns
- IEnumerable<Tchild>
All matching entities.
GetEnumerator()
Returns an enumerator that iterates through the collection.
public override IEnumerator<EcsNode> GetEnumerator()
Returns
- IEnumerator<EcsNode>
An enumerator that can be used to iterate through the collection.
NotifyChildAdopted(EcsNode?, ChildAdoptedNotification)
protected override void NotifyChildAdopted(EcsNode? sender, ChildAdoptedNotification details)
Parameters
sender
EcsNodedetails
ChildAdoptedNotification
NotifyChildIdChanged(EcsNode?, IdChangedNotification)
protected override void NotifyChildIdChanged(EcsNode? sender, IdChangedNotification details)
Parameters
sender
EcsNodedetails
IdChangedNotification
NotifyChildIdChanged(Tchild?, IdChangedNotification)
protected void NotifyChildIdChanged(Tchild? sender, IdChangedNotification details)
Parameters
sender
Tchilddetails
IdChangedNotification