Struct StatChangeInfo
- Namespace
- ElectricDrill.AstraRpgFramework.Stats
- Assembly
- com.electricdrill.astra-rpg-framework.Runtime.dll
Immutable structure that contains information about a stat change event, including the owning entity, stat, and old/new values. Used for tracking and responding to stat modifications and for payload-aware condition evaluation.
public readonly struct StatChangeInfo : IHasValueChange<long>, IHasEntity, IHasTarget
- Implements
-
IHasValueChange<long>
Constructors
StatChangeInfo(EntityStats, StatSO, long, long)
Initializes a new instance of the StatChangeInfo structure.
public StatChangeInfo(EntityStats entity, StatSO stat, long previousValue, long newValue)
Parameters
entityEntityStatsThe EntityStats component that owns the stat.
statStatSOThe stat that was changed.
previousValuelongThe previous value of the stat.
newValuelongThe new value of the stat.
Properties
AbsAmount
The absolute amount of change between PreviousValue and NewValue.
public long AbsAmount { get; }
Property Value
- long
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
EntityStats
Gets the EntityStats component that owns the changed stat.
public EntityStats EntityStats { get; }
Property Value
NewValue
The value of the stat after the change.
public long NewValue { get; }
Property Value
- long
PreviousValue
The value of the stat before the change.
public long PreviousValue { get; }
Property Value
- long
Stat
Gets the stat that was changed.
public StatSO Stat { get; }
Property Value
Target
public EntityCore Target { get; }