add LuaReference::GetLuaType, LuaExpression

This commit is contained in:
Glenn Maynard
2005-02-14 01:31:10 +00:00
parent 8073ebaac5
commit e24c79048e
2 changed files with 39 additions and 0 deletions
+22
View File
@@ -66,6 +66,14 @@ bool LuaReference::IsSet() const
return m_iReference != LUA_NOREF;
}
int LuaReference::GetLuaType() const
{
this->PushSelf();
int iRet = lua_type( LUA->L, -1 );
lua_pop( LUA->L, 1 );
return iRet;
}
void LuaReference::Register()
{
}
@@ -98,6 +106,20 @@ void LuaReference::ReRegister()
}
void LuaExpression::SetFromExpression( const CString &sExpression )
{
m_sExpression = sExpression;
Register();
}
void LuaExpression::Register()
{
LUA->RunScript( "return " + m_sExpression, 1 );
/* Store the result. */
this->SetFromStack();
}
/*
* (c) 2005 Glenn Maynard, Chris Danford
* All rights reserved.