ActivityField
One field on an ActivityEvent. Read-only or writable; numeric fields can carry min/max validation.
public class ActivityField
Inheritance System.Object → ActivityField
Properties
CurrentValue
The field’s starting value: the writer-authored default when one is set, otherwise the live variable value at activity-fire time.
public object CurrentValue { get; }
Property Value
HasValue
True once the field has been set via Value. Mandatory fields must reach this state before Complete().
public bool HasValue { get; }
Property Value
Id
Display label — human-id form. Used in expressions, UI, locale keys; renameable.
public string Id { get; }
Property Value
Mandatory
True when Complete() requires a value to be set first. An authored default does not satisfy this — SetField(string, object) still must be called explicitly.
public bool Mandatory { get; }
Property Value
Max
Maximum allowed value (numeric fields). Null when unconstrained.
public object? Max { get; }
Property Value
Min
Minimum allowed value (numeric fields). Null when unconstrained.
public object? Min { get; }
Property Value
ReadOnly
True when the field is displayed only (no SetField mutation allowed).
public bool ReadOnly { get; }
Property Value
Uuid
Canonical key — matches StoryBonsai.Runtime.Models.ActivityVariable.VariableUuid. Stable across writer-renames of Id.
public string Uuid { get; }
Property Value
Value
Current field value — the value set via this property if any, else CurrentValue. Setter validates against Min/Max and rejects read-only fields.
public object? Value { get; set; }
Property Value
Remarks
Studios commonly persist a default into the variable store by writing field.Value = field.CurrentValue on submit when no player input occurred.