Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
LuaHelper Class Reference

#include <helper.h>

+ Inheritance diagram for LuaHelper:

Public Member Functions

template<>
bool readParam (lua_State *L, int index)
 
template<>
s16 readParam (lua_State *L, int index)
 
template<>
int readParam (lua_State *L, int index)
 
template<>
float readParam (lua_State *L, int index)
 
template<>
v2s16 readParam (lua_State *L, int index)
 
template<>
v2f readParam (lua_State *L, int index)
 
template<>
v3f readParam (lua_State *L, int index)
 
template<>
std::string_view readParam (lua_State *L, int index)
 
template<>
std::string readParam (lua_State *L, int index)
 
template<>
std::string_view readParam (lua_State *L, int index)
 Read a string from Lua state L at index without copying it.
 

Static Protected Member Functions

template<typename T >
static T readParam (lua_State *L, int index)
 Read a value using a template type T from Lua state L at index.
 
template<typename T >
static T readParam (lua_State *L, int index, const T &default_value)
 Read a value using a template type T from Lua state L at index.
 

Member Function Documentation

◆ readParam() [1/12]

template<>
bool LuaHelper::readParam ( lua_State * L,
int index )

◆ readParam() [2/12]

template<>
s16 LuaHelper::readParam ( lua_State * L,
int index )

◆ readParam() [3/12]

template<>
int LuaHelper::readParam ( lua_State * L,
int index )

◆ readParam() [4/12]

template<>
float LuaHelper::readParam ( lua_State * L,
int index )

◆ readParam() [5/12]

template<>
v2s16 LuaHelper::readParam ( lua_State * L,
int index )

References read_v2s16().

+ Here is the call graph for this function:

◆ readParam() [6/12]

template<>
v2f LuaHelper::readParam ( lua_State * L,
int index )

References check_v2f().

+ Here is the call graph for this function:

◆ readParam() [7/12]

template<>
v3f LuaHelper::readParam ( lua_State * L,
int index )

References check_v3f().

+ Here is the call graph for this function:

◆ readParam() [8/12]

template<>
std::string_view LuaHelper::readParam ( lua_State * L,
int index )

◆ readParam() [9/12]

template<>
std::string LuaHelper::readParam ( lua_State * L,
int index )

References readParam().

+ Here is the call graph for this function:

◆ readParam() [10/12]

template<typename T >
static T LuaHelper::readParam ( lua_State * L,
int index )
staticprotected

Read a value using a template type T from Lua state L at index.

Template Parameters
Ttype to read from Lua
Parameters
LLua state
indexLua index to read
Returns
read value from Lua

Referenced by ModApiEnvBase::collectNodeIds(), LuaAreaStore::create_object(), LuaPerlinNoise::create_object(), LuaRaycast::create_object(), ModApiMainMenu::getBoolData(), ScriptApiBase::getCurrentModNameInsecure(), MetaDataRef::handleFromTable(), ModApiEnv::l_add_entity(), ModApiParticles::l_add_particle(), ModApiParticles::l_add_particlespawner(), ModApiParticlesLocal::l_add_particlespawner(), LuaItemStack::l_add_wear_by_uses(), LuaPerlinNoiseMap::l_calc_2d_map(), LuaVoxelManip::l_calc_lighting(), ModApiUtil::l_compress(), InvRef::l_contains_item(), ModApiMainMenu::l_copy_dir(), ModApiInventory::l_create_detached_inventory_raw(), ModApiUtil::l_decode_base64(), ModApiUtil::l_decompress(), ModApiServer::l_disconnect_player(), ModApiServer::l_do_async_callback(), ModApiServer::l_dynamic_add_media(), ModApiUtil::l_encode_base64(), ModApiUtil::l_encode_png(), ClientSoundHandle::l_fade(), ModApiEnv::l_find_node_near(), ModApiEnvVM::l_find_node_near(), ModApiEnv::l_find_nodes_in_area(), ModApiEnvVM::l_find_nodes_in_area(), LuaPerlinNoise::l_get_2d(), LuaPerlinNoiseMap::l_get_2d_map(), LuaPerlinNoiseMap::l_get_2d_map_flat(), LuaAreaStore::l_get_areas_in_area(), ObjectRef::l_get_bone_override(), ObjectRef::l_get_bone_position(), LuaSettings::l_get_bool(), ModApiUtil::l_get_dig_params(), ModApiUtil::l_get_dir_list(), ModApiUtil::l_get_hit_params(), ModApiClient::l_get_item_def(), ModApiMainMenu::l_get_mapgen_names(), ModApiStorage::l_get_mod_storage(), ModApiClient::l_get_modpath(), ModApiClient::l_get_node_def(), ModApiEnv::l_get_objects_inside_radius(), ModApiEnv::l_get_perlin(), ObjectRef::l_get_sky(), ModApiUtil::l_get_tool_wear_after_use(), ObjectRef::l_hud_set_hotbar_image(), ObjectRef::l_hud_set_hotbar_selected_image(), ModApiIPC::l_ipc_cas(), ModApiIPC::l_ipc_get(), ModApiIPC::l_ipc_poll(), ModApiIPC::l_ipc_set(), ModApiUtil::l_is_valid_player_name(), ModApiUtil::l_is_yes(), ModApiUtil::l_log(), NodeMetaRef::l_mark_as_private(), ObjectRef::l_move_to(), ModApiServer::l_notify_authentication_modified(), ObjectRef::l_override_day_night_ratio(), ModApiUtil::l_parse_json(), ModApiMapgen::l_place_schematic(), ModApiMapgen::l_place_schematic_on_vmanip(), ObjectRef::l_punch(), ModApiServer::l_register_async_dofile(), ModApiItem::l_register_item_raw(), ModApiServer::l_register_mapgen_script(), ModApiServer::l_request_shutdown(), ModApiUtil::l_rmdir(), ModApiUtil::l_safe_file_write(), ModApiMapgen::l_save_gen_notify(), ModApiMapgen::l_serialize_schematic(), NodeTimerRef::l_set(), ObjectRef::l_set_animation(), ObjectRef::l_set_animation_frame_speed(), ObjectRef::l_set_attach(), ModApiMainMenu::l_set_background(), ObjectRef::l_set_bone_override(), ObjectRef::l_set_bone_position(), LuaSettings::l_set_bool(), ModApiMainMenu::l_set_clouds(), ObjectRef::l_set_eye_offset(), MetaDataRef::l_set_float(), ObjectRef::l_set_formspec_prepend(), ObjectRef::l_set_fov(), ModApiMapgen::l_set_gen_notify(), ObjectRef::l_set_hp(), ObjectRef::l_set_inventory_formspec(), ObjectRef::l_set_local_animation(), ObjectRef::l_set_look_horizontal(), ObjectRef::l_set_look_pitch(), ObjectRef::l_set_look_vertical(), ObjectRef::l_set_look_yaw(), ModApiMapgen::l_set_mapgen_params(), ModApiMapgen::l_set_mapgen_setting(), ModApiMapgen::l_set_mapgen_setting_noiseparams(), ObjectRef::l_set_minimap_modes(), ModApiMapgen::l_set_noiseparams(), ObjectRef::l_set_observers(), ObjectRef::l_set_sky(), ObjectRef::l_set_sprite(), LuaPcgRandom::l_set_state(), MetaDataRef::l_set_string(), ObjectRef::l_set_texture_mod(), ModApiEnv::l_set_timeofday(), ObjectRef::l_set_yaw(), ModApiUtil::l_sha1(), ModApiUtil::l_sha256(), ModApiMainMenu::l_show_path_select_dialog(), ModApiServer::l_sound_fade(), ModApiMainMenuSound::l_sound_play(), ModApiServer::l_sound_play(), NodeTimerRef::l_start(), ModApiUtil::l_urlencode(), ModApiUtil::l_write_json(), LuaVoxelManip::l_write_to_map(), ScriptApiEntity::luaentity_Punch(), ScriptApiEntity::luaentity_run_simple_callback(), ScriptApiBase::luaPanic(), ScriptApiNode::node_on_flood(), ScriptApiNode::node_on_timer(), ScriptApiServer::on_chat_message(), ScriptApiClient::on_inventory_open(), ScriptApiClient::on_item_use(), ScriptApiClient::on_placenode(), ScriptApiPlayer::on_prejoinplayer(), ScriptApiClient::on_punchnode(), ScriptApiPlayer::on_punchplayer(), ScriptApiClient::on_receiving_message(), ScriptApiPlayer::on_respawnplayer(), ScriptApiClient::on_sending_message(), ModApiHttp::read_http_fetch_request(), ScriptApiEnv::read_nodenames(), ModApiCraft::readCraftRecipeShaped(), ModApiCraft::readCraftRecipeShapeless(), ModApiCraft::readCraftReplacements(), readParam(), readParam(), ScriptApiServer::readPrivileges(), ScriptApiSecurity::sl_g_loadfile(), and ScriptApiBase::stackDump().

◆ readParam() [11/12]

template<>
std::string_view LuaHelper::readParam ( lua_State * L,
int index )

Read a string from Lua state L at index without copying it.

Note that the returned string view is only valid as long as the value is on the stack and has not been modified. Be careful.

Parameters
LLua state
indexLua index to read
Returns
string view

◆ readParam() [12/12]

template<typename T >
static T LuaHelper::readParam ( lua_State * L,
int index,
const T & default_value )
inlinestaticprotected

Read a value using a template type T from Lua state L at index.

Template Parameters
Ttype to read from Lua
Parameters
LLua state
indexLua index to read
default_valuedefault value to apply if nil
Returns
read value from Lua or default value if nil

References readParam().

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: