Class EntityLevelChangedContext
- Namespace
- ElectricDrill.AstraRpgFramework.Events.Contexts
- Assembly
- com.electricdrill.astra-rpg-framework.Runtime.dll
Payload describing an entity level change event. Exposes the leveled entity both as a generic payload entity and as the payload target.
public class EntityLevelChangedContext : IHasTarget, IHasEntity, IHasValueChange<int>
- Inheritance
-
objectEntityLevelChangedContext
- Implements
-
IHasValueChange<int>
Constructors
EntityLevelChangedContext(EntityCore, int, int)
Initializes a new instance of EntityLevelChangedContext.
public EntityLevelChangedContext(EntityCore target, int previousValue, int newValue)
Parameters
targetEntityCoreThe entity whose level changed.
previousValueintThe level before the change.
newValueintThe level after the change.
Properties
AbsAmount
The absolute amount of change between PreviousValue and NewValue.
public int AbsAmount { get; }
Property Value
- int
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
NewValue
The level value after the change happened.
public int NewValue { get; }
Property Value
- int
PreviousValue
The level value before the change happened.
public int PreviousValue { get; }
Property Value
- int
Target
public EntityCore Target { get; }