The Battle for Wesnoth  1.17.0-dev
lua_unit_attacks.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 - 2021
3  by Guillaume Melquiond <guillaume.melquiond@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 #include <string>
19 
20 #include "units/attack_type.hpp"
21 
22 struct lua_State;
23 class lua_unit;
24 
25 void push_unit_attacks_table(lua_State* L, int idx);
26 
27 namespace lua_units {
28  std::string register_attacks_metatables(lua_State* L);
29 }
30 
31 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:80
attack_type & luaW_checkweapon(lua_State *L, int idx)
std::shared_ptr< attack_type > attack_ptr
Definition: ptr.hpp:33
std::string register_attacks_metatables(lua_State *L)
void push_unit_attacks_table(lua_State *L, int idx)
int intf_create_attack(lua_State *L)
std::shared_ptr< const attack_type > const_attack_ptr
Definition: ptr.hpp:34