The Battle for Wesnoth  1.19.5+dev
Classes | Namespaces | Typedefs | Functions
lua_formula_bridge.hpp File Reference
#include <functional>
#include <memory>
#include <string>
Include dependency graph for lua_formula_bridge.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  lua_formula_bridge::fwrapper
 

Namespaces

 wfl
 
 lua_formula_bridge
 

Typedefs

using lua_formula_bridge::fpointer = std::unique_ptr< fwrapper, std::function< void(fwrapper *)> >
 

Functions

int lua_formula_bridge::intf_eval_formula (lua_State *)
 Evaluates a formula in the formula engine. More...
 
int lua_formula_bridge::intf_compile_formula (lua_State *)
 
std::string lua_formula_bridge::register_metatables (lua_State *)
 
lua_formula_bridge::fpointer luaW_check_formula (lua_State *L, int idx, bool allow_str)
 Get a formula from the stack. More...
 

Function Documentation

◆ luaW_check_formula()

lua_formula_bridge::fpointer luaW_check_formula ( lua_State *  L,
int  idx,
bool  allow_str 
)

Get a formula from the stack.

If allow_str is true, it compiles a formula string if found. Otherwise, it must be an already-compiled formula. Raises an error if a formula is not found, or if there's an error in compilation. Thus, it never returns a null pointer.

Definition at line 226 of file lua_formula_bridge.cpp.

References formulaKey, and luaW_type_error().

Referenced by lua_formula_bridge::intf_eval_formula().