Search Results for

    Show / Hide Table of Contents

    Class VariableStore

    Centralized variable storage with global and per-asset local scoping. Resolution order: local (current asset) -> global.

    Inheritance
    object
    VariableStore
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Ibralogue
    Assembly: .dll
    Syntax
    public static class VariableStore

    Methods

    | Edit this page View Source

    ClearAll()

    Clears all variables, both global and local.

    Declaration
    public static void ClearAll()
    | Edit this page View Source

    ClearLocals(string)

    Clears local variables for a specific asset.

    Declaration
    public static void ClearLocals(string assetName)
    Parameters
    Type Name Description
    string assetName
    | Edit this page View Source

    ExportState()

    Exports a snapshot of all variable state for serialization by a save system.

    Declaration
    public static VariableSnapshot ExportState()
    Returns
    Type Description
    VariableSnapshot
    | Edit this page View Source

    ImportState(VariableSnapshot)

    Restores variable state from a previously exported snapshot. Clears all existing variables before importing.

    Declaration
    public static void ImportState(VariableSnapshot snapshot)
    Parameters
    Type Name Description
    VariableSnapshot snapshot
    | Edit this page View Source

    IsDefined(string, string)

    Checks whether a variable exists in any scope, including variables explicitly set to null.

    Declaration
    public static bool IsDefined(string assetName, string name)
    Parameters
    Type Name Description
    string assetName
    string name
    Returns
    Type Description
    bool
    | Edit this page View Source

    Resolve(string, string)

    Resolves a variable by name: checks local scope first, then global scope. Returns null if the variable is not defined in any scope.

    Declaration
    public static object Resolve(string assetName, string name)
    Parameters
    Type Name Description
    string assetName
    string name
    Returns
    Type Description
    object
    | Edit this page View Source

    Set(string, string, object)

    Sets a variable using the scoping rule: if the variable already exists in any scope, updates it in place. Otherwise creates it as a local in the given asset.

    Declaration
    public static void Set(string assetName, string name, object value)
    Parameters
    Type Name Description
    string assetName
    string name
    object value
    | Edit this page View Source

    SetGlobal(string, object)

    Sets a variable in the global scope, accessible from all dialogue files.

    Declaration
    public static void SetGlobal(string name, object value)
    Parameters
    Type Name Description
    string name
    object value
    | Edit this page View Source

    SetLocal(string, string, object)

    Sets a variable in a file-local scope, only accessible within that asset.

    Declaration
    public static void SetLocal(string assetName, string name, object value)
    Parameters
    Type Name Description
    string assetName
    string name
    object value
    | Edit this page View Source

    ToString(object)

    Converts a stored variable value to its string representation. Used when substituting variables into dialogue text at runtime.

    Declaration
    public static string ToString(object value)
    Parameters
    Type Name Description
    object value
    Returns
    Type Description
    string

    Events

    | Edit this page View Source

    OnVariableChanged

    Invoked whenever a variable is created or changed. Parameters are (variableName, oldValue, newValue). oldValue is null for new variables.

    Declaration
    public static event Action<string, object, object> OnVariableChanged
    Event Type
    Type Description
    Action<string, object, object>
    • Edit this page
    • View Source
    In this article
    Back to top Ibralogue Docs