summaryrefslogtreecommitdiff
path: root/durt/nodes/(-1440,11,-2580).lua
diff options
context:
space:
mode:
authorautocommitter <autocommitter@linux-forks.de>2025-01-15 00:00:02 +0100
committerautocommitter <autocommitter@linux-forks.de>2025-01-15 00:00:02 +0100
commit0d20b500624044368cade4514087b8fb7a564bc9 (patch)
tree71d3af2e9a5e13fe4241bc3ce7e94b827c15f7b6 /durt/nodes/(-1440,11,-2580).lua
parent3079c165f40dfe240919cd9af097ddf60245e76c (diff)
downloadluaatc_envs-0d20b500624044368cade4514087b8fb7a564bc9.tar.gz
luaatc_envs-0d20b500624044368cade4514087b8fb7a564bc9.tar.bz2
luaatc_envs-0d20b500624044368cade4514087b8fb7a564bc9.zip
State at 2025-01-15
Diffstat (limited to 'durt/nodes/(-1440,11,-2580).lua')
0 files changed, 0 insertions, 0 deletions
*/ #ifndef L_BASE_H_ #define L_BASE_H_ #include "common/c_types.h" #include "common/c_internal.h" extern "C" { #include <lua.h> #include <lauxlib.h> } class ScriptApiBase; class Server; class Environment; class GUIEngine; class ModApiBase { public: static ScriptApiBase* getScriptApiBase(lua_State *L); static Server* getServer(lua_State *L); static Environment* getEnv(lua_State *L); static GUIEngine* getGuiEngine(lua_State *L); // When we are not loading the mod, this function returns "." static std::string getCurrentModPath(lua_State *L); // Get an arbitrary subclass of ScriptApiBase // by using dynamic_cast<> on getScriptApiBase() template<typename T> static T* getScriptApi(lua_State *L) { ScriptApiBase *scriptIface = getScriptApiBase(L); T *scriptIfaceDowncast = dynamic_cast<T*>(scriptIface); if (!scriptIfaceDowncast) { throw LuaError("Requested unavailable ScriptApi - core engine bug!"); } return scriptIfaceDowncast; } static bool registerFunction(lua_State *L, const char* name, lua_CFunction fct, int top ); }; #endif /* L_BASE_H_ */