33 static const char *
Race =
"race";
34 static const char *
Gen =
"name generator";
58 if (strcmp(m,
"traits") == 0) {
76 if (strcmp(m,
"male_name_gen") == 0) {
83 if (strcmp(m,
"female_name_gen") == 0) {
100 static luaL_Reg const callbacks[] = {
109 return "Adding getrace metatable...\n";
126 for (
const race_map::value_type &
race : races)
128 assert(
race.first ==
race.second.id());
LUA_API void lua_createtable(lua_State *L, int narray, int nrec)
bool uses_global_traits() const
#define return_tstring_attrib(name, accessor)
const t_string & name(GENDER gender=MALE) const
const std::string & undead_variation() const
const std::string & id() const
#define return_string_attrib(name, accessor)
unit_type_data unit_types
#define luaL_getmetatable(L, n)
LUALIB_API void luaL_setmetatable(lua_State *L, const char *tname)
LUA_API void * lua_newuserdata(lua_State *L, size_t size)
const config::const_child_itors & additional_traits() const
GLuint GLsizei GLsizei * length
#define return_cfgref_attrib(name, accessor)
const unit_race * find_race(const std::string &) const
#define return_int_attrib(name, accessor)
const t_string & description() const
This namespace contains bindings for lua to hold a pointer to a race, and to access and modify it...
LUA_API const char * lua_pushlstring(lua_State *L, const char *s, size_t len)
LUA_API int lua_setmetatable(lua_State *L, int objindex)
const t_string & plural_name() const
static const char * Race
Implementation for a lua reference to a race, used by the wesnoth in-game races table.
LUALIB_API int luaL_newmetatable(lua_State *L, const char *tname)
void luaW_pushracetable(lua_State *L)
static int impl_race_get(lua_State *L)
Gets some data on a race (__index metamethod).
LUA_API void lua_rawset(lua_State *L, int idx)
const race_map & races() const
LUALIB_API int luaL_argerror(lua_State *L, int narg, const char *extramsg)
const name_generator & generator(GENDER gender) const
#define lua_tostring(L, i)
std::string register_metatable(lua_State *L)
const config::const_child_itors traits() const
void luaW_pushrace(lua_State *L, const unit_race &race)
#define return_bool_attrib(name, accessor)
void luaW_pushconfig(lua_State *L, config const &cfg)
Converts a config object to a Lua table pushed at the top of the stack.
LUALIB_API void luaL_setfuncs(lua_State *L, const luaL_Reg *l, int nup)
unsigned int num_traits() const
std::map< std::string, unit_race > race_map
const config & get_cfg() const
A config object defines a single node in a WML file, with access to child nodes.
LUA_API void lua_rawget(lua_State *L, int idx)
GLsizei const GLcharARB ** string
LUA_API const char * lua_pushstring(lua_State *L, const char *s)
LUA_API void lua_setfield(lua_State *L, int idx, const char *k)
#define luaL_checkstring(L, n)