61 if (strcmp(m,
"traits") == 0) {
71 if (strcmp(m,
"abilities") == 0) {
75 if (strcmp(m,
"attacks") == 0) {
98 return "Adding unit type metatable...\n";
LUA_API void lua_pushlightuserdata(lua_State *L, void *p)
LUA_API void lua_createtable(lua_State *L, int narray, int nrec)
#define lua_pushcfunction(L, f)
#define return_tstring_attrib(name, accessor)
const t_string & type_name() const
The name of the unit in the current language setting.
void luaW_pushunittype(lua_State *L, const std::string &id)
Create a lua object containing a reference to a unittype, and a metatable to access the properties...
This namespace contains bindings for lua to hold a reference to a unit type and access its stats...
std::string register_metatable(lua_State *L)
std::vector< std::string > get_ability_list() const
#define return_string_attrib(name, accessor)
unit_type_data unit_types
LUALIB_API void luaL_setmetatable(lua_State *L, const char *tname)
void lua_push(lua_State *L, const T &val)
GLuint GLsizei GLsizei * length
#define return_cfgref_attrib(name, accessor)
#define return_int_attrib(name, accessor)
static const char * UnitType
Implementation for a lua reference to a unit_type.
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)
std::string race_id() const
Returns the ID of this type's race without the need to build the type.
LUALIB_API int luaL_newmetatable(lua_State *L, const char *tname)
LUA_API void lua_rawset(lua_State *L, int idx)
config::const_child_itors possible_traits() const
LUALIB_API int luaL_argerror(lua_State *L, int narg, const char *extramsg)
#define lua_tostring(L, i)
LUA_API void lua_rawseti(lua_State *L, int idx, int n)
LUA_API void lua_pushvalue(lua_State *L, int idx)
const config & get_cfg() const
int experience_needed(bool with_acceleration=true) const
#define LUA_REGISTRYINDEX
void luaW_pushconfig(lua_State *L, config const &cfg)
Converts a config object to a Lua table pushed at the top of the stack.
static int impl_unit_type_get(lua_State *L)
Gets some data on a unit type (__index metamethod).
const unit_type * find(const std::string &key, unit_type::BUILD_STATUS status=unit_type::FULL) const
Finds a unit_type by its id() and makes sure it is built to the specified level.
luatypekey const uattacksKey
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)
const std::string & id() const
The id for this unit_type.
#define luaL_checkstring(L, n)