#include "scripting/lua_race.hpp"#include "units/race.hpp"#include "scripting/lua_common.hpp"#include "scripting/push_check.hpp"#include "units/types.hpp"#include <string>#include <cstring>Go to the source code of this file.
Namespaces | |
| lua_race | |
| This namespace contains bindings for lua to hold a pointer to a race, and to access and modify it. | |
Functions | |
| static int | impl_race_get (lua_State *L) |
| Gets some data on a race (__index metamethod). More... | |
| static int | impl_race_tostring (lua_State *L) |
| Turns a lua proxy race to string. More... | |
| std::string | lua_race::register_metatable (lua_State *L) |
| void | luaW_pushrace (lua_State *L, const unit_race &race) |
| void | luaW_pushracetable (lua_State *L) |
| const unit_race & | luaW_checkrace (lua_State *L, int idx) |
Variables | |
| static const char * | Race = "race" |
| Implementation for a lua reference to a race, used by the wesnoth in-game races table. More... | |
| static const char * | Gen = "name generator" |
|
static |
Gets some data on a race (__index metamethod).
Definition at line 42 of file lua_race.cpp.
References unit_race::additional_traits(), unit_race::description(), unit_race::FEMALE, Gen, unit_race::generator(), unit_race::get_cfg(), luaW_checkrace(), luaW_pushconfig(), unit_race::MALE, unit_race::name(), unit_race::num_traits(), unit_race::plural_name(), return_bool_attrib, return_cfgref_attrib, return_int_attrib, return_string_attrib, return_tstring_attrib, unit_type_data::traits(), unit_race::undead_variation(), unit_types, and unit_race::uses_global_traits().
Referenced by lua_race::register_metatable().
|
static |
Turns a lua proxy race to string.
(__tostring metamethod)
Definition at line 93 of file lua_race.cpp.
References unit_race::id(), lua_push(), and luaW_checkrace().
Referenced by lua_race::register_metatable().
| const unit_race& luaW_checkrace | ( | lua_State * | L, |
| int | idx | ||
| ) |
Definition at line 143 of file lua_race.cpp.
References unit_type_data::find_race(), and unit_types.
Referenced by impl_race_get(), and impl_race_tostring().
| void luaW_pushrace | ( | lua_State * | L, |
| const unit_race & | race | ||
| ) |
Definition at line 122 of file lua_race.cpp.
References unit_race::id(), and Race.
Referenced by luaW_pushracetable().
| void luaW_pushracetable | ( | lua_State * | L | ) |
Definition at line 130 of file lua_race.cpp.
References luaW_pushrace(), unit_type_data::races(), and unit_types.
Referenced by game_lua_kernel::initialize().
|
static |
Definition at line 34 of file lua_race.cpp.
Referenced by impl_race_get().
|
static |
Implementation for a lua reference to a race, used by the wesnoth in-game races table.
Definition at line 33 of file lua_race.cpp.
Referenced by luaW_pushrace(), and lua_race::register_metatable().