Struct AttributeChangeInfo
- Namespace
- ElectricDrill.AstraRpgFramework.Attributes
- Assembly
- com.electricdrill.astra-rpg-framework.Runtime.dll
Immutable structure that contains information about an attribute value change. Used to track and communicate attribute modifications across the system and for payload-aware condition evaluation.
public readonly struct AttributeChangeInfo : IHasValueChange<long>, IHasEntity, IHasTarget
- Implements
-
IHasValueChange<long>
Constructors
AttributeChangeInfo(EntityAttributes, AttributeSO, long, long)
Initializes a new instance of the AttributeChangeInfo structure.
public AttributeChangeInfo(EntityAttributes entityAttributes, AttributeSO attribute, long previousValue, long newValue)
Parameters
entityAttributesEntityAttributesThe EntityAttributes instance that owns the changed attribute
attributeAttributeSOThe attribute that was changed
previousValuelongprevious value before the change
newValuelongThe new value after the change
Properties
AbsAmount
The absolute amount of change between PreviousValue and NewValue.
public long AbsAmount { get; }
Property Value
- long
Attribute
Gets the attribute that was changed.
public AttributeSO Attribute { get; }
Property Value
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
EntityAttributes
Gets the EntityAttributes instance that owns the changed attribute.
public EntityAttributes EntityAttributes { get; }
Property Value
NewValue
Gets the new value of the attribute after the change.
public long NewValue { get; }
Property Value
- long
PreviousValue
Gets the previous value of the attribute before the change.
public long PreviousValue { get; }
Property Value
- long
Target
public EntityCore Target { get; }