The Battle for Wesnoth  1.19.0-dev
lua_team.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2024
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 
18 class team;
19 struct 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  */
27 namespace 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. */
32 void luaW_pushteam(lua_State *, team &);
33 
34 /** Test if the top stack element is a team, and if so, return it */
35 team* luaW_toteam(lua_State*, int);
36 
37 /** Test if the top stack element is a team, and if not, error */
38 team& luaW_checkteam(lua_State*, int);
39 
40 /** Get a team either from a direct userdata or from a side number */
41 team& luaW_checkteam(lua_State* L, int idx, class game_board& board);
Game board class.
Definition: game_board.hpp:46
This class stores all the data for a single 'side' (in game nomenclature).
Definition: team.hpp:74
void luaW_pushteam(lua_State *, team &)
Create a full userdata containing a pointer to the team.
Definition: lua_team.cpp:340
team & luaW_checkteam(lua_State *, int)
Test if the top stack element is a team, and if not, error.
Definition: lua_team.cpp:347
team * luaW_toteam(lua_State *, int)
Test if the top stack element is a team, and if so, return it.
Definition: lua_team.cpp:366
This namespace contains bindings for lua to hold a pointer to a team, and to access and modify it.
Definition: lua_team.cpp:303
std::string register_metatable(lua_State *L)
Definition: lua_team.cpp:305