diff options
author | Mattes D <github@xoft.cz> | 2015-05-12 09:20:54 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-05-12 09:20:54 +0200 |
commit | 4b97569b3a635260cc9ce71470fc9b09cfb38167 (patch) | |
tree | 70af92a6a479fcf58cc1b7dd7f9ac4105f01261f /src/Bindings/LuaState.h | |
parent | ToLua: Fixed LuaJit compatibility. (diff) | |
download | cuberite-4b97569b3a635260cc9ce71470fc9b09cfb38167.tar cuberite-4b97569b3a635260cc9ce71470fc9b09cfb38167.tar.gz cuberite-4b97569b3a635260cc9ce71470fc9b09cfb38167.tar.bz2 cuberite-4b97569b3a635260cc9ce71470fc9b09cfb38167.tar.lz cuberite-4b97569b3a635260cc9ce71470fc9b09cfb38167.tar.xz cuberite-4b97569b3a635260cc9ce71470fc9b09cfb38167.tar.zst cuberite-4b97569b3a635260cc9ce71470fc9b09cfb38167.zip |
Diffstat (limited to 'src/Bindings/LuaState.h')
-rw-r--r-- | src/Bindings/LuaState.h | 85 |
1 files changed, 11 insertions, 74 deletions
diff --git a/src/Bindings/LuaState.h b/src/Bindings/LuaState.h index 959a62bb8..b38401fd8 100644 --- a/src/Bindings/LuaState.h +++ b/src/Bindings/LuaState.h @@ -33,50 +33,12 @@ extern "C" #include "../Vector3.h" #include "../Defines.h" #include "PluginManager.h" +#include "LuaState_Typedefs.inc" - - - - -class cBlockArea; -class cBlockEntity; -class cBoundingBox; -class cChunkDesc; -class cClientHandle; -class cCraftingGrid; -class cCraftingRecipe; -class cEntity; -class cHopperEntity; -class cItem; -class cItems; +// fwd: class cLuaServerHandle; class cLuaTCPLink; class cLuaUDPEndpoint; -class cMapManager; -class cMonster; -class cPickup; -class cPlayer; -class cPlugin; -class cPluginLua; -class cProjectileEntity; -class cRoot; -class cScoreboard; -class cTNTEntity; -class cWebAdmin; -class cWindow; -class cWorld; -struct HTTPRequest; -struct HTTPTemplateRequest; -struct TakeDamageInfo; - -typedef cBlockArea * pBlockArea; -typedef cBoundingBox * pBoundingBox; -typedef cMapManager * pMapManager; -typedef cPluginManager * pPluginManager; -typedef cRoot * pRoot; -typedef cScoreboard * pScoreboard; -typedef cWorld * pWorld; -typedef cClientHandle * pClientHandle; @@ -214,35 +176,15 @@ public: void Push(const Vector3i & a_Vector); void Push(const Vector3i * a_Vector); - // Push a value onto the stack (keep alpha-sorted): + // Push a simple value onto the stack (keep alpha-sorted): void Push(bool a_Value); - void Push(cBlockEntity * a_BlockEntity); - void Push(cChunkDesc * a_ChunkDesc); - void Push(cClientHandle * a_ClientHandle); - void Push(cEntity * a_Entity); - void Push(cHopperEntity * a_Hopper); - void Push(cItem * a_Item); - void Push(cItems * a_Items); - void Push(cLuaServerHandle * a_ServerHandle); - void Push(cLuaTCPLink * a_TCPLink); - void Push(cLuaUDPEndpoint * a_UDPEndpoint); - void Push(cMonster * a_Monster); - void Push(cPickup * a_Pickup); - void Push(cPlayer * a_Player); - void Push(cPlugin * a_Plugin); - void Push(cPluginLua * a_Plugin); - void Push(cProjectileEntity * a_ProjectileEntity); - void Push(cTNTEntity * a_TNTEntity); - void Push(cWebAdmin * a_WebAdmin); - void Push(cWindow * a_Window); - void Push(cWorld * a_World); void Push(double a_Value); void Push(int a_Value); - void Push(TakeDamageInfo * a_TDI); - void Push(Vector3d * a_Vector); - void Push(Vector3i * a_Vector); void Push(void * a_Ptr); void Push(std::chrono::milliseconds a_time); + void Push(cLuaServerHandle * a_ServerHandle); + void Push(cLuaTCPLink * a_TCPLink); + void Push(cLuaUDPEndpoint * a_UDPEndpoint); // GetStackValue() retrieves the value at a_StackPos, if it is a valid type. If not, a_Value is unchanged. // Enum values are clamped to their allowed range. @@ -252,17 +194,12 @@ public: void GetStackValue(int a_StackPos, cPluginManager::CommandResult & a_Result); void GetStackValue(int a_StackPos, cRef & a_Ref); void GetStackValue(int a_StackPos, double & a_Value); - void GetStackValue(int a_StackPos, float & a_ReturnedVal); void GetStackValue(int a_StackPos, eWeather & a_Value); + void GetStackValue(int a_StackPos, float & a_ReturnedVal); void GetStackValue(int a_StackPos, int & a_Value); - void GetStackValue(int a_StackPos, pBlockArea & a_Value); - void GetStackValue(int a_StackPos, pBoundingBox & a_Value); - void GetStackValue(int a_StackPos, pClientHandle & a_Value); - void GetStackValue(int a_StackPos, pMapManager & a_Value); - void GetStackValue(int a_StackPos, pPluginManager & a_Value); - void GetStackValue(int a_StackPos, pRoot & a_Value); - void GetStackValue(int a_StackPos, pScoreboard & a_Value); - void GetStackValue(int a_StackPos, pWorld & a_Value); + + // Include the auto-generated Push and GetStackValue() functions: + #include "LuaState_Declaration.inc" /** Call the specified Lua function. Returns true if call succeeded, false if there was an error. @@ -441,7 +378,7 @@ protected: bool PushFunction(const cTableRef & a_TableRef); /** Pushes a usertype of the specified class type onto the stack */ - void PushUserType(void * a_Object, const char * a_Type); + // void PushUserType(void * a_Object, const char * a_Type); /** Calls the function that has been pushed onto the stack by PushFunction(), |