Table of Contents

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

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

entity EntityStats

The EntityStats component that owns the stat.

stat StatSO

The stat that was changed.

previousValue long

The previous value of the stat.

newValue long

The 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

EntityCore

EntityStats

Gets the EntityStats component that owns the changed stat.

public EntityStats EntityStats { get; }

Property Value

EntityStats

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

StatSO

Target

public EntityCore Target { get; }

Property Value

EntityCore