Table of Contents

Class EcsNode

Namespace
ReFuel.Ecs
Assembly
ReFuel.dll

Base class for all ECS nodes.

public abstract class EcsNode : IDisposable
Inheritance
EcsNode
Implements
Derived
Inherited Members

Constructors

EcsNode()

public EcsNode()

Properties

Attributes

The attributes associated with this node.

public IReadOnlyDictionary<string, object> Attributes { get; }

Property Value

IReadOnlyDictionary<string, object>

Context

The context of this entity.

public EcsContext Context { get; }

Property Value

EcsContext

Id

Entity ID of this node.

public Guid Id { get; }

Property Value

Guid

IsDisposed

Is this instance disposed?

protected bool IsDisposed { get; }

Property Value

bool

IsGameThread

True if this is the game thread.

public bool IsGameThread { get; }

Property Value

bool

this[Guid]

Get child by GUID.

public EcsNode this[Guid id] { get; }

Parameters

id Guid

Property Value

EcsNode

Exceptions

KeyNotFoundException

Entity does not exist.

this[Guid, bool]

public EcsNode this[Guid id, bool rawget] { get; }

Parameters

id Guid
rawget bool

Property Value

EcsNode

Kind

public abstract EcsNodeKind Kind { get; }

Property Value

EcsNodeKind

Name

Name of this node.

public string Name { get; set; }

Property Value

string

Parent

The parent of this entity.

public EcsNode? Parent { get; }

Property Value

EcsNode

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

Internal function to handle dispose behavior.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

True if disposing.

DisposeGuarded(bool)

protected void DisposeGuarded(bool disposing)

Parameters

disposing bool

~EcsNode()

protected ~EcsNode()

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

HasAttribute(string)

public bool HasAttribute(string name)

Parameters

name string

Returns

bool

HasAttribute<T>()

public bool HasAttribute<T>()

Returns

bool

Type Parameters

T

NotifyBroadcast<T>(EcsNode?, T)

Notify this entity and its childrenList.

public void NotifyBroadcast<T>(EcsNode? sender, T details)

Parameters

sender EcsNode
details T

The notification message.

Type Parameters

T

The notification type.

Notify<T>(EcsNode?, T)

Notify this entity.

public void Notify<T>(EcsNode? sender, T details)

Parameters

sender EcsNode
details T

The notification message.

Type Parameters

T

The notification type.

OnNotify<T>(EcsNode?, T)

protected virtual void OnNotify<T>(EcsNode? sender, T details)

Parameters

sender EcsNode
details T

Type Parameters

T

RecallAttribute(string)

Recall an attribute from this node.

public object RecallAttribute(string name)

Parameters

name string

Attribute name.

Returns

object

Attribute object instance.

RecallAttribute<T>()

public T RecallAttribute<T>()

Returns

T

Type Parameters

T

RecallAttribute<T>(string)

Recall an attribute from this node.

public T RecallAttribute<T>(string name)

Parameters

name string

Attribute name.

Returns

T

Attribute object instance.

Type Parameters

T

Attribute object type.

StoreAttribute(string, object?)

Store an attribute in this node.

public void StoreAttribute(string name, object? data)

Parameters

name string

VertexAttribute name.

data object

VertexAttribute object instance.

StoreAttribute<T>(string, T?)

Store an attribute in this node.

public void StoreAttribute<T>(string name, T? data)

Parameters

name string

Attribute name.

data T

Attribute object instance.

Type Parameters

T

Attribute object type.

StoreAttribute<T>(T?)

Store an attribute with a predefined GUID.

public void StoreAttribute<T>(T? data)

Parameters

data T

The attribtue data.

Type Parameters

T

The attribute type.

SubscribeNotification<T>(NotifyHandler<T>)

Subscribe to a notification.

public void SubscribeNotification<T>(NotifyHandler<T> handler)

Parameters

handler NotifyHandler<T>

The handler that will subscribe.

Type Parameters

T

The notification type.

TryGet(Guid, out EcsNode?, bool)

public bool TryGet(Guid id, out EcsNode? node, bool rawget = false)

Parameters

id Guid
node EcsNode
rawget bool

Returns

bool

TryGet<T>(Guid, out T?, bool)

public bool TryGet<T>(Guid id, out T? node, bool rawget = false) where T : EcsNode

Parameters

id Guid
node T
rawget bool

Returns

bool

Type Parameters

T

TryRecallAttribute(out object?, string)

Try recalling an attribute from this node.

public bool TryRecallAttribute(out object? attribute, string name)

Parameters

attribute object

Attribute object instance.

name string

Attribute name.

Returns

bool

True if the attribute is found.

TryRecallAttribute<T>(out T?)

public bool TryRecallAttribute<T>(out T? attribute)

Parameters

attribute T

Returns

bool

Type Parameters

T

TryRecallAttribute<T>(out T?, string)

Try recalling an attribute from this node.

public bool TryRecallAttribute<T>(out T? attribute, string name)

Parameters

attribute T

Attribute object instance.

name string

Attribute name.

Returns

bool

True if the attribute is found.

Type Parameters

T

Attribute object type.

UnsubscribeNotification<T>(NotifyHandler<T>)

Unsubscribe from a notification.

public void UnsubscribeNotification<T>(NotifyHandler<T> handler)

Parameters

handler NotifyHandler<T>

The handler that will unsubscribe.

Type Parameters

T

The notification type.

Events

Notified

public event NotifyHandler? Notified

Event Type

NotifyHandler