Class Archetype

Namespace
Elegy.ECS
Assembly
Elegy.ECS.dll

Data for event handling, as a complement to fennecs.Archetype.

public class Archetype
Inheritance
Archetype
Inherited Members

Properties

ComplexEventHandlers

Event handlers with parametres. The parametre type is marked with EventModelAttribute.

public Dictionary<Type, List<Action<Entity, object>>> ComplexEventHandlers { get; init; }

Property Value

Dictionary<Type, List<Action<Entity, object>>>

ComponentMask

Component IDs encoded as a bitset. Component ID 1 would be the 1st bit and so on.

public long[] ComponentMask { get; init; }

Property Value

long[]

EventHandlers

Parametreless event handlers. Refer to EventHandlerAttribute and EventAttribute<T>.

public Dictionary<Type, List<Action<Entity>>> EventHandlers { get; init; }

Property Value

Dictionary<Type, List<Action<Entity>>>

Ready

Whether or not this archetype has been finished, and is ready to be used to handle events.

public bool Ready { get; set; }

Property Value

bool

Methods

DecodeComponentMask(long[])

public static List<int> DecodeComponentMask(long[] componentIds)

Parameters

componentIds long[]

Returns

List<int>

EncodeComponentMask(IEnumerable<int>)

public static long[] EncodeComponentMask(IEnumerable<int> componentIds)

Parameters

componentIds IEnumerable<int>

Returns

long[]

Matches(long[])

public bool Matches(long[] componentMask)

Parameters

componentMask long[]

Returns

bool

TestPosition(long[], int)

public static bool TestPosition(long[] componentIds, int id)

Parameters

componentIds long[]
id int

Returns

bool