Table of Contents

Class EcsContainer<Tchild>

Namespace
ReFuel.Ecs
Assembly
ReFuel.dll
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

int

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 Tchild

The 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 Tchild

The 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 string

The 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 EcsNode
details ChildAdoptedNotification

NotifyChildIdChanged(EcsNode?, IdChangedNotification)

protected override void NotifyChildIdChanged(EcsNode? sender, IdChangedNotification details)

Parameters

sender EcsNode
details IdChangedNotification

NotifyChildIdChanged(Tchild?, IdChangedNotification)

protected void NotifyChildIdChanged(Tchild? sender, IdChangedNotification details)

Parameters

sender Tchild
details IdChangedNotification