Context
Namespace: Bang.Contexts
Assembly: Bang.dll
public class Context : Observer, IDisposable
Context is the pool of entities accessed by each system that defined it.
Implements: Observer, IDisposable
⭐ Properties
Entities
public virtual ImmutableArray<T> Entities { get; }
Entities that are currently active in the context.
Returns
ImmutableArray<T>
Entity
public Entity Entity { get; }
Get the single entity present in the context. This assumes that the context targets a unique component. TODO: Add flag that checks for unique components within this context.
Returns
Entity
HasAnyEntity
public bool HasAnyEntity { get; }
Whether the context has any entity active.
Returns
bool
World
public readonly World World;
Returns
World
⭐ Methods
TryGetUniqueEntity()
public Entity TryGetUniqueEntity()
Tries to get a unique entity, if none is available, returns null
Returns
Entity
Dispose()
public virtual void Dispose()
⚡