21#ifndef __LUAENGINE_H__
22#define __LUAENGINE_H__
31#include "scripting/scriptprocessor.h"
37 namespace TileMap {
class ITileMap; }
38 namespace Sound {
class SoundManager; }
45 namespace Lua {
class LuaCollisionListener; }
79 lua_State *m_pLuaState;
80 SunLight :: Scripting :: ScriptProcessor *m_pScriptProcessor;
81 Engine :: Lua :: TimerMap m_Timers;
82 Engine :: Lua :: LuaCollisionListener *m_pCollisionListener;
83 std :: string m_strAppDirectory;
85 void RegisterCalls(
void );
89 LuaEngine( SunLight :: Scripting :: ScriptProcessor *pScriptProcessor );
92 bool RunFile( std :: string strFileName );
98 void Init( Engine :: IRendererProvider *pRendererProvider,
99 SunLight :: Sound :: SoundManager *pSoundManager,
100 Engine :: SpritePool *pSpritePool );
Implements a C++ abstraction for using Lua engine;.
Definition luaengine.h:77
int GetActiveEnemyCount(void)
Ask Lua how many enemies it currently has active, via the optional global get_active_enemy_count()....
Definition luaengine.cpp:266
bool RunFile(std ::string strFileName)
Execute a lua script - this is the ONE entry point that loads the game's very first script (EngineHos...
Definition luaengine.cpp:461
bool TryDispatchMoveSpritesToScreen(uint16_t nStateId)
Dispatch a MOVE_SPRITES_TO_SCREEN_CMD state id to Lua, via the optional global on_move_sprites_to_scr...
Definition luaengine.cpp:155
const std::string & GetApplicationDirectory(void) const
Return the running executable's own directory (also exposed to Lua as APP_DIR by Init above) - used b...
Definition luaengine.cpp:396
void AttachToTileMap(SunLight ::TileMap ::ITileMap &tileMap)
Attach the collision listener to a renderer's collision manager. Called by the renderer provider's cr...
Definition luaengine.cpp:369
void InstallVirtualClock(void)
Headless (–headless) only - make Lua's own os.time()/ os.clock() follow the null renderer's virtual c...
Definition luaengine.cpp:381
bool TryDispatchLoadStage(uint16_t nStageId)
Give Lua first refusal on a LOAD_STAGE_CMD state id, via the optional Lua global on_load_stage(stageI...
Definition luaengine.cpp:211
virtual ~LuaEngine(void)
Destructor. Finalize all class data;.
Definition luaengine.cpp:425
void CallOnUpdate(uint32_t nDeltaMilli)
Call the optional Lua on_update(dt) global once per frame, if defined. Absent global is a silent no-o...
Definition luaengine.cpp:105
void Init(Engine ::IRendererProvider *pRendererProvider, SunLight ::Sound ::SoundManager *pSoundManager, Engine ::SpritePool *pSpritePool)
Give Lua access to the renderer provider/SoundManager/SpritePool and register the primitive API modul...
Definition luaengine.cpp:313
Definition irendererprovider.h:32
Definition irendererprovider.h:27