The Battle for Wesnoth 1.21.0-dev
 
Loading...
Searching...
No Matches
lua_team.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2014 - 2025
3 by Chris Beck <render787@gmail.com>
4 Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY.
12
13 See the COPYING file for more details.
14*/
15
16#pragma once
17
18class team;
19struct lua_State;
20
21#include <string>
22
23/**
24 * This namespace contains bindings for lua to hold a pointer to a team,
25 * and to access and modify it.
26 */
27namespace lua_team {
28 std::string register_metatable(lua_State *);
29} //end namespace lua_team
30
31/** Create a full userdata containing a pointer to the team. */
32void luaW_pushteam(lua_State *, team &);
33
34/** Test if the top stack element is a team, and if so, return it */
35team* luaW_toteam(lua_State*, int);
36
37/** Test if the top stack element is a team, and if not, error */
38team& luaW_checkteam(lua_State*, int);
39
40/** Get a team either from a direct userdata or from a side number */
41team& luaW_checkteam(lua_State* L, int idx, class game_board& board);
Game board class.
This class stores all the data for a single 'side' (in game nomenclature).
Definition team.hpp:74
team & luaW_checkteam(lua_State *, int)
Test if the top stack element is a team, and if not, error.
Definition lua_team.cpp:542
void luaW_pushteam(lua_State *, team &)
Create a full userdata containing a pointer to the team.
Definition lua_team.cpp:535
team * luaW_toteam(lua_State *, int)
Test if the top stack element is a team, and if so, return it.
Definition lua_team.cpp:561
This namespace contains bindings for lua to hold a pointer to a team, and to access and modify it.
Definition lua_team.cpp:497
std::string register_metatable(lua_State *L)
Definition lua_team.cpp:499