Added LuaInstance::Call
Former-commit-id: 3bbf04804868ab46dfcf1f9c30ad4de621c880b8
This commit is contained in:
parent
36b39ec868
commit
88c3b9d482
|
|
@ -35,6 +35,9 @@ class NAZARA_API NzLuaInstance : NzNonCopyable
|
||||||
int ArgError(unsigned int argNum, const char* error);
|
int ArgError(unsigned int argNum, const char* error);
|
||||||
int ArgError(unsigned int argNum, const NzString& error);
|
int ArgError(unsigned int argNum, const NzString& error);
|
||||||
|
|
||||||
|
bool Call(unsigned int argCount);
|
||||||
|
bool Call(unsigned int argCount, unsigned int resultCount);
|
||||||
|
|
||||||
void CheckAny(int index) const;
|
void CheckAny(int index) const;
|
||||||
bool CheckBoolean(int index) const;
|
bool CheckBoolean(int index) const;
|
||||||
bool CheckBoolean(int index, bool defValue) const;
|
bool CheckBoolean(int index, bool defValue) const;
|
||||||
|
|
|
||||||
|
|
@ -159,6 +159,16 @@ int NzLuaInstance::ArgError(unsigned int argNum, const NzString& error)
|
||||||
return luaL_argerror(m_state, argNum, error.GetConstBuffer());
|
return luaL_argerror(m_state, argNum, error.GetConstBuffer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool NzLuaInstance::Call(unsigned int argCount)
|
||||||
|
{
|
||||||
|
return lua_pcall(m_state, argCount, LUA_MULTRET, 0) == LUA_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NzLuaInstance::Call(unsigned int argCount, unsigned int resultCount)
|
||||||
|
{
|
||||||
|
return lua_pcall(m_state, argCount, resultCount, 0) == LUA_OK;
|
||||||
|
}
|
||||||
|
|
||||||
void NzLuaInstance::CheckAny(int index) const
|
void NzLuaInstance::CheckAny(int index) const
|
||||||
{
|
{
|
||||||
luaL_checkany(m_state, index);
|
luaL_checkany(m_state, index);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue