The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Namespaces | Functions | Variables
lua_team.cpp File Reference
#include "scripting/lua_team.hpp"
#include "scripting/lua_common.hpp"
#include "team.hpp"
#include <string>
#include "lua/lua.h"
#include "lua/lauxlib.h"
Include dependency graph for lua_team.cpp:

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...
 

Function Documentation

static int impl_side_get ( lua_State L)
static
static int impl_side_set ( lua_State L)
static
void luaW_pushteam ( lua_State L,
team tm 
)

Definition at line 173 of file lua_team.cpp.

References lua_newuserdata(), luaL_setmetatable(), and Team.

Referenced by game_lua_kernel::intf_get_sides().

Variable Documentation

const char* Team = "side"
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().