42 static const char *
Team =
"side";
94 if (strcmp(m,
"recruit") == 0) {
95 const std::set<std::string>& recruits = t.
recruits();
98 for (
const std::string& r : t.
recruits()) {
148 auto* disp = lua_kernel_base::get_lua_kernel<game_lua_kernel>(L).get_display();
151 disp->reinit_flags_for_side(t.
side());
165 team::SHARE_VISION v;
169 return luaL_argerror(L, 3,
"Invalid share_vision value (should be 'all', 'none', or 'shroud')");
173 if (strcmp(m,
"carryover_bonus") == 0) {
178 if (strcmp(m,
"recruit") == 0) {
181 for (
int i = 1;; ++
i) {
190 std::string err_msg =
"unknown modifiable property of side: ";
227 return "Adding getside metatable...\n";
246 return *
static_cast<team **
>(
p);
#define modify_bool_attrib(name, accessor)
bool no_turn_confirmation() const
LUALIB_API void * luaL_checkudata(lua_State *L, int ud, const char *tname)
LUA_API void lua_createtable(lua_State *L, int narray, int nrec)
void set_shroud(bool shroud)
#define return_tstring_attrib(name, accessor)
LUALIB_API lua_Number luaL_checknumber(lua_State *L, int arg)
void set_side_name(const t_string &new_name)
team & luaW_checkteam(lua_State *L, int idx)
Test if the top stack element is a team, and if not, error.
void set_carryover_add(bool value)
void luaW_pushteam(lua_State *L, team &tm)
Create a full userdata containing a pointer to the team.
void set_objectives(const t_string &new_objectives, bool silently=false)
LUA_API void lua_pushboolean(lua_State *L, int b)
LUA_API int lua_rawgeti(lua_State *L, int idx, lua_Integer n)
t_string side_name_tstr() const
This namespace contains bindings for lua to hold a pointer to a team, and to access and modify it...
const std::string & flag() const
bool carryover_add() const
LUA_API void lua_rawseti(lua_State *L, int idx, lua_Integer n)
bool objectives_changed() const
#define return_string_attrib(name, accessor)
void set_recall_cost(int cost)
const std::string & save_id() const
void set_persistent(bool value)
LUALIB_API void luaL_setmetatable(lua_State *L, const char *tname)
void set_defeat_condition_string(const std::string &value)
sets the defeat condition if
void add_recruit(const std::string &)
void set_share_vision(const std::string &vision_status)
void set_hidden(bool value)
double carryover_bonus() const
void set_carryover_percentage(int value)
int village_support() const
LUA_API void * lua_newuserdata(lua_State *L, size_t size)
const std::string & faction() const
static const char * Team
Implementation for a lua reference to a team, used by the wesnoth in-game sides table.
void set_scroll_to_leader(bool value)
void set_no_turn_confirmation(bool value)
std::string register_metatable(lua_State *L)
void write(config &cfg) const
This class stores all the data for a single 'side' (in game nomenclature).
SHARE_VISION share_vision() const
#define modify_tstring_attrib(name, accessor)
void set_carryover_bonus(double value)
LUALIB_API int luaL_argerror(lua_State *L, int arg, const char *extramsg)
#define modify_string_attrib(name, accessor)
#define return_int_attrib(name, accessor)
bool luaW_getglobal(lua_State *L, const std::vector< std::string > &path)
Pushes the value found by following the variadic names (char *), if the value is not nil...
static int impl_side_equal(lua_State *L)
team_data calculate_team_data(const class team &tm) const
int carryover_percentage() const
void set_lost(bool value=true)
const t_string & faction_name() const
void set_village_support(int support)
bool chose_random() const
LUALIB_API void * luaL_testudata(lua_State *L, int ud, const char *tname)
void set_village_gold(int income)
#define return_cfg_attrib(name, accessor)
LUALIB_API int luaL_newmetatable(lua_State *L, const char *tname)
void set_gold(int amount)
static int impl_side_set(lua_State *L)
Sets some data on a side (__newindex metamethod).
const std::string & flag_icon() const
const t_string & objectives() const
#define lua_tostring(L, i)
DEFEAT_CONDITION defeat_condition() const
void set_flag_icon(const std::string &flag_icon)
void set_objectives_changed(bool c=true) const
void change_controller_by_wml(const std::string &new_controller)
team * luaW_toteam(lua_State *L, int idx)
Test if the top stack element is a team, and if so, return it.
bool get_scroll_to_leader() const
#define return_bool_attrib(name, accessor)
bool luaW_getmetafield(lua_State *L, int idx, const char *key)
Like luaL_getmetafield, but returns false if key is an empty string or begins with two underscores...
const std::string & color() const
#define lua_istable(L, n)
#define return_float_attrib(name, accessor)
static int impl_side_get(lua_State *L)
Gets some data on a side (__index metamethod).
void change_team(const std::string &name, const t_string &user_name)
void set_base_income(int amount)
void set_recruits(const std::set< std::string > &recruits)
LUALIB_API void luaL_setfuncs(lua_State *L, const luaL_Reg *l, int nup)
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 & team_name() const
const t_string & user_team_name() const
const std::set< std::string > & recruits() const
#define modify_int_attrib(name, accessor)
void set_color(const std::string &color)
#define return_cstring_attrib(name, accessor)
#define luaL_checkstring(L, n)
CONTROLLER controller() const