The Battle for Wesnoth  1.15.2+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 ,
int   
)

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

Definition at line 241 of file lua_unit_type.cpp.

References luaL_checkudata(), and UnitType.

Referenced by impl_unit_type_equal(), and impl_unit_type_get().

◆ luaW_pushunittype()

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.

Definition at line 227 of file lua_unit_type.cpp.

References lua_newuserdata(), luaL_setmetatable(), and UnitType.

Referenced by impl_unit_type_lookup(), and impl_unit_type_next().

◆ luaW_tounittype()

const unit_type* luaW_tounittype ( lua_State ,
int   
)

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

Definition at line 233 of file lua_unit_type.cpp.

References luaL_testudata(), p, and UnitType.

Referenced by impl_unit_attacks_get(), impl_unit_attacks_len(), impl_unit_attacks_set(), impl_unit_type_equal(), and lua_gui2::intf_set_dialog_value().