summaryrefslogtreecommitdiffstats
path: root/src/Bindings/LuaState.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-08-16 13:02:08 +0200
committerMattes D <github@xoft.cz>2016-08-22 20:09:56 +0200
commit9493488e48c49a54e9b1ec892107735de6736c13 (patch)
treee8f2756003714cf54ebda9168016130b5c0a1432 /src/Bindings/LuaState.h
parentcLuaState: Added support for optional params and AStringMap values. (diff)
downloadcuberite-9493488e48c49a54e9b1ec892107735de6736c13.tar
cuberite-9493488e48c49a54e9b1ec892107735de6736c13.tar.gz
cuberite-9493488e48c49a54e9b1ec892107735de6736c13.tar.bz2
cuberite-9493488e48c49a54e9b1ec892107735de6736c13.tar.lz
cuberite-9493488e48c49a54e9b1ec892107735de6736c13.tar.xz
cuberite-9493488e48c49a54e9b1ec892107735de6736c13.tar.zst
cuberite-9493488e48c49a54e9b1ec892107735de6736c13.zip
Diffstat (limited to 'src/Bindings/LuaState.h')
-rw-r--r--src/Bindings/LuaState.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Bindings/LuaState.h b/src/Bindings/LuaState.h
index 303a59327..3c07ac5d2 100644
--- a/src/Bindings/LuaState.h
+++ b/src/Bindings/LuaState.h
@@ -327,14 +327,21 @@ public:
T & m_Dest;
};
+
/** A dummy class that's used only to delimit function args from return values for cLuaState::Call() */
class cRet
{
} ;
-
static const cRet Return; // Use this constant to delimit function args from return values for cLuaState::Call()
+ /** A dummy class that's used only to push a constant nil as a function parameter in Call(). */
+ class cNil
+ {
+ };
+ static const cNil Nil; // Use this constant to give a function a nil parameter in Call()
+
+
/** A RAII class for values pushed onto the Lua stack.
Will pop the value off the stack in the destructor. */
class cStackValue
@@ -489,8 +496,6 @@ public:
Push(std::forward<Arg2>(a_Arg2), std::forward<Args>(a_Args)...);
}
- void PushNil(void);
-
// Push a const value onto the stack (keep alpha-sorted):
void Push(const AString & a_String);
void Push(const AStringMap & a_Dictionary);
@@ -499,6 +504,7 @@ public:
void Push(const cCraftingRecipe * a_Recipe);
void Push(const char * a_Value);
void Push(const cItems & a_Items);
+ void Push(const cNil & a_Nil);
void Push(const cPlayer * a_Player);
void Push(const cRef & a_Ref);
void Push(const HTTPRequest * a_Request);