The Battle for Wesnoth  1.17.0-dev
Classes | Functions
lua_formula_bridge Namespace Reference


class  fwrapper


int intf_eval_formula (lua_State *)
 Evaluates a formula in the formula engine. More...
int intf_compile_formula (lua_State *)
std::string register_metatables (lua_State *)

Function Documentation

◆ intf_compile_formula()

int lua_formula_bridge::intf_compile_formula ( lua_State L)

◆ intf_eval_formula()

int lua_formula_bridge::intf_eval_formula ( lua_State L)

Evaluates a formula in the formula engine.

  • Arg 1: Formula string.
  • Arg 2: optional context; can be a unit or a Lua table.
  • Ret 1: Result of the formula.

Definition at line 210 of file lua_formula_bridge.cpp.

References lua_formula_bridge::fwrapper::evaluate(), formulaKey, lua_istable, luaL_checkstring, luaL_testudata(), luaW_pushfaivariant(), and luaW_tounit().

Referenced by lua_kernel_base::lua_kernel_base(), and register_metatables().

◆ register_metatables()

std::string lua_formula_bridge::register_metatables ( lua_State L)