summaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_base.h
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2018-06-30 17:11:38 +0200
committerGitHub <noreply@github.com>2018-06-30 17:11:38 +0200
commiteef62c82a2e58700fc1216b0b8c03e421bc77995 (patch)
tree4c49e659069036cb53d69535dc33d33f29d963f4 /src/script/lua_api/l_base.h
parent227c71eb76e019873b30e2d3893b68307d51d58f (diff)
downloadminetest-eef62c82a2e58700fc1216b0b8c03e421bc77995.tar.gz
minetest-eef62c82a2e58700fc1216b0b8c03e421bc77995.tar.bz2
minetest-eef62c82a2e58700fc1216b0b8c03e421bc77995.zip
Modernize lua read (part 2 & 3): C++ templating assurance (#7410)
* Modernize lua read (part 2 & 3): C++ templating assurance Implement the boolean reader Implement the string reader Also remove unused & unimplemented script_error_handler Add a reader with default value
Diffstat (limited to 'src/script/lua_api/l_base.h')
-rw-r--r--src/script/lua_api/l_base.h16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/script/lua_api/l_base.h b/src/script/lua_api/l_base.h
index d0160f03b..12c1a86cc 100644
--- a/src/script/lua_api/l_base.h
+++ b/src/script/lua_api/l_base.h
@@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "common/c_types.h"
#include "common/c_internal.h"
+#include "common/helper.h"
#include "gamedef.h"
extern "C" {
@@ -37,7 +38,7 @@ class Server;
class Environment;
class GUIEngine;
-class ModApiBase {
+class ModApiBase : protected LuaHelper {
public:
static ScriptApiBase* getScriptApiBase(lua_State *L);
@@ -69,17 +70,4 @@ public:
const char* name,
lua_CFunction func,
int top);
-
- static bool isNaN(lua_State *L, int idx);
-
- /**
- * Read a value using a template type T from Lua State L and index
- *
- * @tparam T type to read from Lua
- * @param L Lua state
- * @param index Lua Index to read
- * @return read value from Lua
- */
- template<typename T>
- static T readParam(lua_State *L, int index);
};