The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Functions
lua_formula_bridge Namespace Reference

Classes

class  fwrapper
 

Functions

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

int lua_formula_bridge::intf_compile_formula ( lua_State L)
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 207 of file lua_formula_bridge.cpp.

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

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

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