The Battle for Wesnoth  1.19.0-dev
Namespaces | Functions
lua_unit_type.hpp File Reference
#include <string>
Include dependency graph for lua_unit_type.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 lua_unit_type
 This namespace contains bindings for lua to hold a reference to a unit type and access its stats.
 

Functions

std::string lua_unit_type::register_metatable (lua_State *L)
 
std::string lua_unit_type::register_table (lua_State *L)
 
void luaW_pushunittype (lua_State *, const unit_type &)
 Create a lua object containing a reference to a unittype, and a metatable to access the properties. More...
 
const unit_typeluaW_tounittype (lua_State *, int)
 Test if a stack element is a unit type, and return it if so. More...
 
const unit_typeluaW_checkunittype (lua_State *, int)
 Test if a stack element is a unit type, and return it if so. More...
 

Function Documentation

◆ luaW_checkunittype()

const unit_type& luaW_checkunittype ( lua_State *  L,
int  idx 
)

Test if a stack element is a unit type, and return it if so.

Definition at line 260 of file lua_unit_type.cpp.

References UnitType.

Referenced by impl_unit_type_equal(), impl_unit_type_get(), and impl_unit_type_tostring().

◆ luaW_pushunittype()

void luaW_pushunittype ( lua_State *  L,
const unit_type ut 
)

Create a lua object containing a reference to a unittype, and a metatable to access the properties.

Definition at line 246 of file lua_unit_type.cpp.

References UnitType.

Referenced by impl_unit_type_lookup(), impl_unit_type_next(), and luaW_pushfaivariant().

◆ luaW_tounittype()

const unit_type* luaW_tounittype ( lua_State *  L,
int  idx 
)

Test if a stack element is a unit type, and return it if so.

Definition at line 252 of file lua_unit_type.cpp.

References p, and UnitType.

Referenced by impl_unit_attacks_get(), impl_unit_attacks_len(), impl_unit_attacks_set(), impl_unit_type_equal(), lua_formula_bridge::intf_eval_formula(), luaW_tofaivariant(), and WIDGET_SETTER().