#include "scripting/lua_common.hpp"
#include "scripting/lua_widget.hpp"
#include "global.hpp"
#include "tstring.hpp"
#include "map/location.hpp"
#include "lua/lauxlib.h"
#include "lua/lua.h"
#include <cassert>
#include <string_view>
#include <type_traits>
Go to the source code of this file.
Namespaces | |
lua_check_impl | |
Functions | |
template<typename T > | |
std::enable_if_t< std::is_same_v< T, lua_index_raw >, lua_index_raw > | lua_check_impl::lua_check (lua_State *L, int n) |
template<typename T > | |
std::enable_if_t< std::is_same_v< T, lua_index_raw >, lua_index_raw > | lua_check_impl::lua_to_or_default (lua_State *L, int n, const T &) |
template<typename T > | |
std::enable_if_t< std::is_same_v< T, std::string >, std::string > | lua_check_impl::lua_check (lua_State *L, int n) |
template<typename T > | |
std::enable_if_t< std::is_same_v< T, std::string >, void > | lua_check_impl::lua_push (lua_State *L, const T &val) |
template<typename T > | |
std::enable_if_t< std::is_same_v< T, std::string_view >, std::string_view > | lua_check_impl::lua_check (lua_State *L, int n) |
template<typename T > | |
std::enable_if_t< std::is_same_v< T, std::string_view >, std::string_view > | lua_check_impl::lua_to_or_default (lua_State *L, int n, const T &def) |
template<typename T > | |
std::enable_if_t< std::is_same_v< T, std::string_view >, void > | lua_check_impl::lua_push (lua_State *L, const T &val) |
template<typename T > | |
std::enable_if_t< std::is_same_v< T, config >, config > | lua_check_impl::lua_check (lua_State *L, int n) |
template<typename T > | |
std::enable_if_t< std::is_same_v< T, config >, void > | lua_check_impl::lua_push (lua_State *L, const config &val) |
template<typename T > | |
std::enable_if_t< std::is_same_v< T, map_location >, map_location > | lua_check_impl::lua_check (lua_State *L, int n) |
template<typename T > | |
std::enable_if_t< std::is_same_v< T, map_location >, map_location > | lua_check_impl::lua_to_or_default (lua_State *L, int n, const T &def) |
template<typename T > | |
std::enable_if_t< std::is_same_v< T, map_location >, void > | lua_check_impl::lua_push (lua_State *L, const map_location &val) |
template<typename T > | |
std::enable_if_t< std::is_base_of_v< enum_tag, T >, T > | lua_check_impl::lua_check (lua_State *L, int n) |
template<typename T > | |
std::enable_if_t< std::is_base_of_v< enum_tag, T >, T > | lua_check_impl::lua_to_or_default (lua_State *L, int n, const T &def) |
template<typename T > | |
std::enable_if_t< std::is_base_of_v< enum_tag, T >, void > | lua_check_impl::lua_push (lua_State *L, T val) |
template<typename T > | |
std::enable_if_t< std::is_same_v< T, t_string >, t_string > | lua_check_impl::lua_check (lua_State *L, int n) |
template<typename T > | |
std::enable_if_t< std::is_same_v< T, t_string >, void > | lua_check_impl::lua_push (lua_State *L, const t_string &val) |
template<typename T > | |
std::enable_if_t< std::is_same_v< T, gui2::widget >, void > | lua_check_impl::lua_push (lua_State *L, gui2::widget &val) |
template<typename T > | |
std::enable_if_t< std::is_same_v< T, bool >, bool > | lua_check_impl::lua_check (lua_State *L, int n) |
template<typename T > | |
std::enable_if_t< std::is_same_v< T, bool >, bool > | lua_check_impl::lua_to_or_default (lua_State *L, int n, const T &) |
template<typename T > | |
std::enable_if_t< std::is_same_v< T, bool >, void > | lua_check_impl::lua_push (lua_State *L, bool val) |
template<typename T > | |
std::enable_if_t< std::is_floating_point_v< T >, T > | lua_check_impl::lua_check (lua_State *L, int n) |
template<typename T > | |
std::enable_if_t< std::is_floating_point_v< T >, T > | lua_check_impl::lua_to_or_default (lua_State *L, int n, const T &def) |
template<typename T > | |
std::enable_if_t< std::is_floating_point_v< T >, void > | lua_check_impl::lua_push (lua_State *L, T val) |
template<typename T > | |
std::enable_if_t< std::is_integral_v< T > &&!std::is_same_v< T, bool >, T > | lua_check_impl::lua_check (lua_State *L, int n) |
template<typename T > | |
std::enable_if_t< std::is_integral_v< T > &&!std::is_same_v< T, bool >, T > | lua_check_impl::lua_to_or_default (lua_State *L, int n, const T &def) |
template<typename T > | |
std::enable_if_t< std::is_integral_v< T > &&!std::is_same_v< T, bool >, void > | lua_check_impl::lua_push (lua_State *L, T val) |
template<typename T > | |
std::enable_if_t< is_pair< T >::value &&!std::is_const_v< typename T::first_type >, T > | lua_check_impl::lua_check (lua_State *L, int n) |
template<typename T > | |
std::enable_if_t< is_pair< T >::value &&!std::is_const_v< typename T::first_type >, void > | lua_check_impl::lua_push (lua_State *L, const T &val) |
template<typename T > | |
std::enable_if_t< is_container< T >::value &&!std::is_same_v< T, std::string > &&!std::is_same_v< T, std::string_view >, T > | lua_check_impl::lua_check (lua_State *L, int n) |
template<typename T > | |
std::enable_if_t< is_container< T >::value &&!std::is_same_v< T, std::string > &&!std::is_same_v< T, std::string_view > &&!is_map< T >::value, void > | lua_check_impl::lua_push (lua_State *L, const T &list) |
template<typename T > | |
std::enable_if_t< is_map< T >::value, void > | lua_check_impl::lua_push (lua_State *L, const T &map) |
template<typename T > | |
std::decay_t< T > | lua_check (lua_State *L, int n) |
template<typename T > | |
std::decay_t< T > | lua_to_or_default (lua_State *L, int n, const T &def) |
template<typename T > | |
void | lua_push (lua_State *L, const T &val) |
template<typename T > | |
std::decay_t< T > | luaW_table_get_def (lua_State *L, int index, std::string_view k, const T &def) |
returns t[k] where k is the table at index index and k is k or def if it is not convertible to the correct type. More... | |
template<typename T > | |
void | luaW_table_set (lua_State *L, int index, std::string_view k, const T &value) |
std::decay_t<T> lua_check | ( | lua_State * | L, |
int | n | ||
) |
Definition at line 370 of file push_check.hpp.
References n.
void lua_push | ( | lua_State * | L, |
const T & | val | ||
) |
Definition at line 384 of file push_check.hpp.
Referenced by ai::cfun_ai_get_avoid(), ai::impl_ai_aspect_get(), impl_color_tostring(), game_lua_kernel::impl_get_terrain_info(), lua_common::impl_gettext_tostr(), impl_music_get(), impl_race_tostring(), impl_unit_attack_tostring(), impl_unit_type_get(), impl_unit_type_tostring(), impl_warn(), intf_add_item_of_type(), lua_fileops::intf_canonical_path(), intf_default_generate(), intf_deprecated_message(), lua_stringx::intf_format(), lua_stringx::intf_format_list(), intf_get_language(), lua_map_location::intf_get_tiles_in_radius(), lua_kernel_base::intf_kernel_type(), intf_random(), lua_fileops::intf_read_file(), lua_stringx::intf_str_join(), lua_stringx::intf_str_join_map(), lua_stringx::intf_str_map_split(), lua_stringx::intf_str_paren_split(), lua_stringx::intf_str_split(), intf_synchronize_choices(), luaW_getwidgetcallback(), luaW_setwidgetcallback(), luaW_table_set(), game_lua_kernel::mouse_over_hex_callback(), and game_lua_kernel::select_hex_callback().
std::decay_t<T> lua_to_or_default | ( | lua_State * | L, |
int | n, | ||
const T & | def | ||
) |
Definition at line 377 of file push_check.hpp.
References n.
std::decay_t<T> luaW_table_get_def | ( | lua_State * | L, |
int | index, | ||
std::string_view | k, | ||
const T & | def | ||
) |
returns t[k] where k is the table at index index and k is k or def if it is not convertible to the correct type.
Definition at line 394 of file push_check.hpp.
References lua_index_raw::index, lua_gettable(), lua_isnoneornil, lua_istable, lua_pop, lua_pushlstring(), and luaL_argerror().
Referenced by lua_stringx::intf_str_map_split(), lua_stringx::intf_str_split(), and intf_terrain_mask().
void luaW_table_set | ( | lua_State * | L, |
int | index, | ||
std::string_view | k, | ||
const T & | value | ||
) |
Definition at line 416 of file push_check.hpp.
References lua_absindex(), lua_istable, lua_push(), lua_pushlstring(), lua_settable(), and luaL_argerror().
Referenced by luaW_pushsinglecolor().