asobi_lua_phases (asobi v0.75.1)

View Source

Shared phase-list decoding for the Lua match and world bridges.

asobi_lua_match:phases/1 and asobi_lua_world:phases/1 both decode the same shape from a Lua script's phases() return value - a list of { name = ..., duration = ..., start = ..., config = ... } tables. This module holds that decode logic once so neither bridge forks it.

Summary

Functions

decode_phase_start/1

-spec decode_phase_start(term()) -> prev_ended | all_ready | {timer, integer()} | {players, integer()}.

decode_phases(PhasesRef, LuaSt)

-spec decode_phases(term(), dynamic()) -> [map()].

maybe_add(Map, Key, Props, LuaKey, DecodeFn)

-spec maybe_add(map(), atom(), list(), binary(), fun((term()) -> term())) -> map().

to_integer/1

-spec to_integer(term()) -> integer().

type_of/1

-spec type_of(term()) -> binary().