PGE Engine
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
Public Member Functions | Protected Member Functions | Friends | List of all members
LuaEngine Class Reference

This class should have basic functions for interacting with lua To run the lua engine you have to construct the lua engine and then call init() After that you can interpret any lua string with the interpretLua function. More...

#include <lua_engine.h>

Inheritance diagram for LuaEngine:
LuaCreditsEngine LuaLevelEngine LuaTitleScreenEngine LuaWorldEngine

Public Member Functions

 LuaEngine (Scene *scene)
 
void init ()
 Init a new lua engine. The lua engine must be in a invalid state.
 
void shutdown ()
 Shutdowns the lua engine and post a cleanup event.
 
void forceShutdown ()
 Shutdowns the lua engine directly.
 
bool isValid ()
 isValid Checks if the lua engine is valid More...
 
luabind::object loadClassAPI (const QString &path)
 Reads a lua class and returns the object.
 
void loadClassAPI (const QString &nameInGlobal, const QString &path)
 Reads a lua class and puts it in a global object.
 
QString coreFile () const
 The core lua filename.
 
void setCoreFile (const QString &coreFile)
 The core lua filename.
 
void dispatchEvent (LuaEvent &toDispatchEvent)
 Dispatches a lua event.
 
void setErrorReporterFunc (const std::function< void(const QString &, const QString &)> &func)
 The error reporter function.
 
ScenegetBaseScene () const
 The base-scene for the lua engine (may need for interacting with current scene)
 
QString getLuaScriptPath () const
 
void setLuaScriptPath (const QString &luaScriptPath)
 
bool shouldShutdown () const
 
void setLateShutdown (bool value)
 
void postLateShutdownError (luabind::error &error)
 
void runGarbageCollector ()
 
QString getUserFile () const
 
void setUserFile (const QString &userFile)
 

Protected Member Functions

virtual void onBindAll ()
 
void loadMultiRet (QFile *file)
 
lua_State * getNativeState ()
 

Friends

class LuaEvent
 

Detailed Description

This class should have basic functions for interacting with lua To run the lua engine you have to construct the lua engine and then call init() After that you can interpret any lua string with the interpretLua function.

To add custom class for luabind this class should be derived. As custom features can be added.

Member Function Documentation

bool LuaEngine::isValid ( )
inline

isValid Checks if the lua engine is valid

Returns
True, if the engine is valid

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