FieldVariable

Internal variable implementation backed by a reflected field on an object.

Definition

Namespace: Paragon.Core.ActionSystem Assembly: Paragon.dll Access: internal

[Serializable]
internal sealed class FieldVariable : Variable

Inheritance: Variable → FieldVariable

Description

FieldVariable wraps a field on an action class, allowing the action system to get and set values via reflection. This is used for fields marked with the [Variable] attribute.

circle-info

Field variables are automatically created for fields decorated with [Variable].

Constructor

FieldVariable(object, FieldInfo)

Creates a field variable bound to a specific field on an object.

public FieldVariable(object owner, FieldInfo fieldInfo)
Parameter
Type
Description

owner

object

The object containing the field

fieldInfo

FieldInfo

Reflection info for the field

Methods

SetValue(object)

Sets the field value on the owner object via reflection.

GetValue()

Gets the field value from the owner object via reflection.

Returns: object — The field's current value

Implementation Details

The FieldInfo is lazily cached after first access for performance. It uses BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic to support both public and private fields.

See Also

Last updated

Was this helpful?