The Battle for Wesnoth  1.15.1+dev
lua_unit_attacks.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 - 2018 by Guillaume Melquiond <guillaume.melquiond@gmail.com>
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #pragma once
16 
17 #include <string>
18 
19 #include "units/attack_type.hpp"
20 
21 struct lua_State;
22 class lua_unit;
23 
24 void push_unit_attacks_table(lua_State* L, int idx);
25 
26 namespace lua_units {
27  std::string register_attacks_metatables(lua_State* L);
28 }
29 
30 void luaW_pushweapon(lua_State* L, attack_ptr weapon);
const_attack_ptr luaW_toweapon(lua_State *L, int idx)
void luaW_pushweapon(lua_State *L, attack_ptr weapon)
Storage for a unit, either owned by the Lua code (ptr != 0), a local variable unit (c_ptr != 0)...
Definition: lua_unit.hpp:79
attack_type & luaW_checkweapon(lua_State *L, int idx)
std::shared_ptr< attack_type > attack_ptr
Definition: ptr.hpp:36
std::string register_attacks_metatables(lua_State *L)
void push_unit_attacks_table(lua_State *L, int idx)
std::shared_ptr< const attack_type > const_attack_ptr
Definition: ptr.hpp:37