RuntimeState
A state during the runtime execution of a loreline script. States hold field values that can be accessed and modified during script execution.
Instance Members
scope: IntIf set to a value > 0, this state is temporary and linked to a scope. Every time we enter a new block node, we enter a new scope identified by a unique integer value. When exiting that scope, the related temporary states are destroyed.
fields: AnyFields of this state. Contains the actual data being stored.
originalFields: AnyOriginal field values, as they are initially declared in the script, as long as they are not dependent on other state values. Used for comparison when serializing to avoid storing unchanged values.
clear(interpreter: Interpreter, node: Node): VoidClears all fields in this state.
| Name | Type |
|---|---|
interpreter |
Interpreter |
node |
Node |
new(interpreter: Interpreter, node: Node, fields: Any, originalFields: Any): VoidCreates a new runtime state with optional initial field values.
| Name | Type | Description |
|---|---|---|
interpreter |
Interpreter | |
node |
Node | |
fields |
Any | Initial field values, or null to create empty fields |
originalFields |
Any | Original field values for comparison, or null to create empty original fields |
Private Members
createOriginalFields(): VoidCreates empty original fields.
Metadata
| Name | Parameters |
|---|---|
:hxGen |
- |