add Lua binding

This commit is contained in:
Chris Danford
2005-12-06 12:39:43 +00:00
parent dfad0b0a75
commit 8fda004742
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -1596,6 +1596,8 @@ CString Basename( const CString &dir )
return dir.substr( start, end-start+1 );
}
LuaFunction( Basename, Basename( SArg(1) ) )
/* Return all but the last named component of dir:
* a/b/c -> a/b/
* a/b/c/ -> a/b/
+2
View File
@@ -365,6 +365,7 @@ public:
static int GetDifficulty( T* p, lua_State *L ) { lua_pushnumber(L, p->GetDifficulty() ); return 1; }
static int GetDescription( T* p, lua_State *L ) { lua_pushstring(L, p->GetDescription() ); return 1; }
static int GetMeter( T* p, lua_State *L ) { lua_pushnumber(L, p->GetMeter() ); return 1; }
static int GetFilename( T* p, lua_State *L ) { lua_pushstring(L, p->GetFilename() ); return 1; }
static void Register(lua_State *L)
{
@@ -372,6 +373,7 @@ public:
ADD_METHOD( GetDifficulty );
ADD_METHOD( GetDescription );
ADD_METHOD( GetMeter );
ADD_METHOD( GetFilename );
Luna<T>::Register( L );
}