class

PointClickEngine::Scripting::LuaStateManager

Inherits Reference < Object

Manages state accessible from Lua scripts

Instance methods

clear_state

Clear all state

Source
from_hash(state : Hash(String, Luajit::LuaAny))

Load state from hash

Source
get_state(key : String) : Luajit::LuaAny | Nil

Get a state value

Source
get_states_with_prefix(prefix : String) : Hash(String, Luajit::LuaAny)

Get state filtered by prefix

Source
has_state?(key : String) : Bool

Check if a state key exists

Source
increment_state(key : String, amount : Float64 = 1.0) : Float64 | Nil

Increment a numeric state value

Source
merge_state(other_state : Hash(String, Luajit::LuaAny))

Merge another state hash into this one

Source
on_state_change

Register a callback for state changes

Source
remove_state(key : String) : Bool

Remove a state key

Source
set_state(key : String, value : Luajit::LuaAny | Nil)

Set a state value

Source
state_keys

Get all state keys

Source
to_hash

Get state as hash for serialization

Source
toggle_state(key : String) : Bool

Toggle a boolean state value

Source