Interface IHasEntity
- Namespace
- ElectricDrill.AstraRpgFramework.Contexts
- Assembly
- com.electricdrill.astra-rpg-framework.Runtime.dll
Contract for objects that can provide a reference to their primary EntityCore.
Implemented by two categories:
- Entity components (e.g. EntityCore, EntityStats) where Entity returns the component's own owning entity.
- Event context payloads (e.g. context classes) where Entity returns the primary subject of the event.
This interface enables GameAction<TContext> families typed on IHasEntity to accept both entity components and any domain context that carries an entity reference, bridging the two worlds without requiring inheritance.
public interface IHasEntity
Properties
Entity
The primary EntityCore associated with this object. For entity components this is the owning entity; for context payloads this is the primary affected subject (e.g. the event target).
EntityCore Entity { get; }