#include "scripting/lua_team.hpp"
#include "scripting/lua_common.hpp"
#include "team.hpp"
#include <string>
#include "lua/lua.h"
#include "lua/lauxlib.h"
Go to the source code of this file.
Namespaces | |
lua_team | |
This namespace contains bindings for lua to hold a pointer to a team, and to access and modify it. | |
Functions | |
static int | impl_side_get (lua_State *L) |
Gets some data on a side (__index metamethod). More... | |
static int | impl_side_set (lua_State *L) |
Sets some data on a side (__newindex metamethod). More... | |
std::string | lua_team::register_metatable (lua_State *L) |
void | luaW_pushteam (lua_State *L, team &tm) |
Variables | |
static const char * | Team = "side" |
Implementation for a lua reference to a team, used by the wesnoth in-game sides table. More... | |
Gets some data on a side (__index metamethod).
Definition at line 46 of file lua_team.cpp.
References team::base_income(), team::carryover_add(), team::carryover_bonus(), team::carryover_percentage(), team::color(), team::controller(), team::defeat_condition(), team::faction(), team::faction_name(), team::flag(), team::flag_icon(), team::get_scroll_to_leader(), team::gold(), team::hidden(), i, team::lost(), lua_createtable(), lua_pushstring(), lua_rawseti(), luaL_checkstring, luaL_checkudata(), team::objectives(), team::objectives_changed(), team::persistent(), team::recall_cost(), team::recruits(), return_bool_attrib, return_cfg_attrib, return_cstring_attrib, return_float_attrib, return_int_attrib, return_string_attrib, return_tstring_attrib, team::save_id(), team::share_vision(), team::side(), Team, team::team_name(), team::total_income(), team::user_team_name(), team::uses_fog(), team::uses_shroud(), team::village_gold(), team::village_support(), and team::write().
Referenced by lua_team::register_metatable().
Sets some data on a side (__newindex metamethod).
Definition at line 104 of file lua_team.cpp.
References team::add_recruit(), team::change_controller_by_wml(), team::change_team(), i, lua_isnil, lua_istable, lua_pop, lua_rawgeti(), lua_tostring, luaL_argerror(), luaL_checknumber(), luaL_checkstring, luaL_checkudata(), modify_bool_attrib, modify_int_attrib, modify_string_attrib, modify_tstring_attrib, team::set_base_income(), team::set_carryover_add(), team::set_carryover_bonus(), team::set_carryover_percentage(), team::set_color(), team::set_defeat_condition_string(), team::set_gold(), team::set_hidden(), team::set_lost(), team::set_objectives(), team::set_objectives_changed(), team::set_persistent(), team::set_recall_cost(), team::set_recruits(), team::set_scroll_to_leader(), team::set_village_gold(), team::set_village_support(), Team, team::team_name(), and team::user_team_name().
Referenced by lua_team::register_metatable().
Definition at line 173 of file lua_team.cpp.
References lua_newuserdata(), luaL_setmetatable(), and Team.
Referenced by game_lua_kernel::intf_get_sides().
|
static |
Implementation for a lua reference to a team, used by the wesnoth in-game sides table.
(The userdata has type team** because lua holds only a pointer to a team, not a full-size team. If it were a full object then we would cast to type team *, since checkudata returns a pointer to the type corresponding to the sizeof expr used when we allocated the userdata.)
Definition at line 38 of file lua_team.cpp.
Referenced by impl_side_get(), impl_side_set(), luaW_pushteam(), and lua_team::register_metatable().