Skip to main content

Progress

A general use state machines for scene scripting

Functions

new

Progress:new(
event_init(selfProgress) → (),--

general init callback

event_update(selfProgress) → (),--

general update callback

event_exit(selfProgress) → ()--

general exit callback

) → ()

Construct a new instance

setPermanent

Progress:setPermanent(
idstring--

variable name

) → ()

Use a permanent variable to save the state

add

Progress:add(
namestring,--

state identifier

init(selfProgressState) → (string | nil),--

general init callback

update(selfProgressState) → (string | nil),--

general update callback

exit(selfProgressState) → (string | nil)--

general exit callback

) → ()

Add a state

get

Progress:get() → ()

Get the current state

switch

Progress:switch(
namestring--

state identifier

) → ()

Switch to a state

updateState

Progress:updateState() → ()

Process any pending state changes

update

Progress:update() → ()

Run a single step of the state machine

run

Progress:run() → ()

Continuously run the state machine

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Construct a new instance",
            "params": [
                {
                    "name": "event_init",
                    "desc": "general init callback",
                    "lua_type": "(self: Progress) -> ()"
                },
                {
                    "name": "event_update",
                    "desc": "general update callback",
                    "lua_type": "(self: Progress) -> ()"
                },
                {
                    "name": "event_exit",
                    "desc": "general exit callback",
                    "lua_type": "(self: Progress) -> ()"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 15,
                "path": "../../res/data/script/lib/env/progress.lua"
            }
        },
        {
            "name": "setPermanent",
            "desc": "Use a permanent variable to save the state",
            "params": [
                {
                    "name": "id",
                    "desc": "variable name",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 37,
                "path": "../../res/data/script/lib/env/progress.lua"
            }
        },
        {
            "name": "add",
            "desc": "Add a state",
            "params": [
                {
                    "name": "name",
                    "desc": "state identifier",
                    "lua_type": "string"
                },
                {
                    "name": "init",
                    "desc": "general init callback",
                    "lua_type": "(self: ProgressState) -> (string | nil)"
                },
                {
                    "name": "update",
                    "desc": "general update callback",
                    "lua_type": "(self: ProgressState) -> (string | nil)"
                },
                {
                    "name": "exit",
                    "desc": "general exit callback",
                    "lua_type": "(self: ProgressState) -> (string | nil)"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 48,
                "path": "../../res/data/script/lib/env/progress.lua"
            }
        },
        {
            "name": "get",
            "desc": "Get the current state",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 55,
                "path": "../../res/data/script/lib/env/progress.lua"
            }
        },
        {
            "name": "switch",
            "desc": "Switch to a state",
            "params": [
                {
                    "name": "name",
                    "desc": "state identifier",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 78,
                "path": "../../res/data/script/lib/env/progress.lua"
            }
        },
        {
            "name": "updateState",
            "desc": "Process any pending state changes",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 85,
                "path": "../../res/data/script/lib/env/progress.lua"
            }
        },
        {
            "name": "update",
            "desc": "Run a single step of the state machine",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 139,
                "path": "../../res/data/script/lib/env/progress.lua"
            }
        },
        {
            "name": "run",
            "desc": "Continuously run the state machine",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 231,
                "path": "../../res/data/script/lib/env/progress.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Progress",
    "desc": "A general use state machines for scene scripting",
    "source": {
        "line": 7,
        "path": "../../res/data/script/lib/env/progress.lua"
    }
}