Class EntityClassChangedContext
- Namespace
- ElectricDrill.AstraRpgFramework.Events.Contexts
- Assembly
- com.electricdrill.astra-rpg-framework.Runtime.dll
Payload describing an entity class change event. Exposes the entity both as a generic payload entity and as the payload target.
public class EntityClassChangedContext : IHasTarget, IHasEntity
- Inheritance
-
objectEntityClassChangedContext
- Implements
Constructors
EntityClassChangedContext(EntityCore, ClassSO, ClassSO)
Initializes a new instance of EntityClassChangedContext.
public EntityClassChangedContext(EntityCore target, ClassSO previousClass, ClassSO newClass)
Parameters
targetEntityCoreThe entity whose class changed, or null when the EntityClass component raising the change has no EntityCore sibling.
previousClassClassSOThe class before the change.
newClassClassSOThe class after the change.
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).
public EntityCore Entity { get; }
Property Value
NewClass
The class assigned to the entity after the change happened.
public ClassSO NewClass { get; }
Property Value
PreviousClass
The class assigned to the entity before the change happened.
public ClassSO PreviousClass { get; }
Property Value
Target
public EntityCore Target { get; }