#include "scripting/lua_unit_type.hpp"
#include "scripting/lua_common.hpp"
#include "scripting/push_check.hpp"
#include "units/types.hpp"
#include <string>
#include <string.h>
#include "lua/lua.h"
#include "lua/lauxlib.h"
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 | |
static int | impl_unit_type_get (lua_State *L) |
Gets some data on a unit type (__index metamethod). More... | |
std::string | lua_unit_type::register_metatable (lua_State *L) |
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. More... | |
Variables | |
static const char * | UnitType = "unit type" |
Implementation for a lua reference to a unit_type. More... | |
Gets some data on a unit type (__index metamethod).
Definition at line 40 of file lua_unit_type.cpp.
References unit_type::cost(), unit_type::experience_needed(), unit_type_data::find(), unit_type::get_ability_list(), unit_type::get_cfg(), unit_type::hitpoints(), unit_type::id(), unit_type::level(), lua_createtable(), lua_newtable, lua_push(), lua_pushlightuserdata(), lua_pushlstring(), lua_pushstring(), lua_pushvalue(), lua_rawget(), lua_rawset(), lua_rawseti(), LUA_REGISTRYINDEX, lua_setmetatable(), lua_tostring, luaL_argerror(), luaL_checkstring, luaW_pushconfig(), unit_type::movement(), unit_type::possible_traits(), unit_type::race_id(), unit_type::recall_cost(), return_cfgref_attrib, return_int_attrib, return_string_attrib, return_tstring_attrib, unit_type::type_name(), uattacksKey, and unit_types.
Referenced by lua_unit_type::register_metatable().
void luaW_pushunittype | ( | lua_State * | , |
const std::string & | |||
) |
Create a lua object containing a reference to a unittype, and a metatable to access the properties.
Definition at line 102 of file lua_unit_type.cpp.
References lua_createtable(), lua_pushstring(), lua_setfield(), luaL_setmetatable(), and UnitType.
Referenced by game_lua_kernel::initialize().
|
static |
Implementation for a lua reference to a unit_type.
Definition at line 32 of file lua_unit_type.cpp.
Referenced by luaW_pushunittype(), and lua_unit_type::register_metatable().