The Battle for Wesnoth  1.19.6+dev
lua_unit_attacks.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 - 2024
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 
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, const attack_ptr& weapon);
31 void luaW_pushweapon(lua_State* L, const const_attack_ptr& weapon);
32 const_attack_ptr luaW_toweapon(lua_State* L, int idx);
33 attack_type& luaW_checkweapon(lua_State* L, int idx);
34 int intf_create_attack(lua_State* L);
int intf_create_attack(lua_State *L)
const_attack_ptr luaW_toweapon(lua_State *L, int idx)
void luaW_pushweapon(lua_State *L, const attack_ptr &weapon)
void push_unit_attacks_table(lua_State *L, int idx)
attack_type & luaW_checkweapon(lua_State *L, int idx)
std::string register_attacks_metatables(lua_State *L)
std::shared_ptr< const attack_type > const_attack_ptr
Definition: ptr.hpp:34
std::shared_ptr< attack_type > attack_ptr
Definition: ptr.hpp:33