ComponentsLookup

Namespace: Bang
Assembly: Bang.dll

public abstract class ComponentsLookup

Implemented by generators in order to provide a mapping of all the types to their respective id.

⭐ Constructors

protected ComponentsLookup()

⭐ Properties

ComponentsIndex

protected ImmutableDictionary<TKey, TValue> ComponentsIndex { get; protected set; }

Maps all the components to their unique id.

Returns
ImmutableDictionary<TKey, TValue>

MessagesIndex

protected ImmutableDictionary<TKey, TValue> MessagesIndex { get; protected set; }

Maps all the messages to their unique id.

Returns
ImmutableDictionary<TKey, TValue>

NextLookupId

public static const int NextLookupId;

Tracks the last id this particular implementation is tracking plus one.

Returns
int

RelativeComponents

public ImmutableHashSet<T> RelativeComponents { get; protected set; }

List of all the unique id of the components that inherit from IParentRelativeComponent.

Returns
ImmutableHashSet<T>

⭐ Methods

IsRelative(int)

public bool IsRelative(int id)

Returns whether a is relative to its parent.

Parameters
id int

Returns
bool

Id(Type)

public int Id(Type t)

Get the id for component type.

Parameters
t Type

Returns
int