The Battle for Wesnoth  1.19.5+dev
Classes | Functions | Variables
lua_formula_bridge.cpp File Reference
#include "scripting/lua_formula_bridge.hpp"
#include "game_board.hpp"
#include "scripting/lua_unit.hpp"
#include "scripting/lua_common.hpp"
#include "scripting/lua_team.hpp"
#include "scripting/lua_unit_attacks.hpp"
#include "scripting/lua_unit_type.hpp"
#include "lua/wrapper_lauxlib.h"
#include "formula/callable_objects.hpp"
#include "formula/formula.hpp"
#include "variable.hpp"
#include "resources.hpp"
#include "units/map.hpp"
#include "units/unit.hpp"
Include dependency graph for lua_formula_bridge.cpp:

Go to the source code of this file.

Classes

class  lua_callable
 

Functions

void luaW_pushfaivariant (lua_State *L, variant val)
 
variant luaW_tofaivariant (lua_State *L, int i)
 
lua_formula_bridge::fpointer luaW_check_formula (lua_State *L, int idx, bool allow_str)
 Get a formula from the stack. More...
 
static int impl_formula_collect (lua_State *L)
 
static int impl_formula_tostring (lua_State *L)
 

Variables

static const char formulaKey [] = "formula"
 

Function Documentation

◆ impl_formula_collect()

static int impl_formula_collect ( lua_State *  L)
static

Definition at line 302 of file lua_formula_bridge.cpp.

Referenced by lua_formula_bridge::register_metatables().

◆ impl_formula_tostring()

static int impl_formula_tostring ( lua_State *  L)
static

◆ 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().

◆ luaW_pushfaivariant()

void luaW_pushfaivariant ( lua_State *  L,
variant  val 
)

◆ luaW_tofaivariant()

variant luaW_tofaivariant ( lua_State *  L,
int  i 
)

Variable Documentation

◆ formulaKey

const char formulaKey[] = "formula"
static