add lua bindings
This commit is contained in:
@@ -1129,6 +1129,33 @@ void Course::GetAllCachedTrails( vector<Trail *> &out )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// lua start
|
||||||
|
#include "LuaBinding.h"
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
class LunaCourse : public Luna<T>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LunaCourse() { LUA->Register( Register ); }
|
||||||
|
|
||||||
|
static int GetPlayMode( T* p, lua_State *L ) { lua_pushnumber(L, p->GetPlayMode() ); return 1; }
|
||||||
|
static int GetFullDisplayTitle( T* p, lua_State *L ) { lua_pushstring(L, p->GetFullDisplayTitle() ); return 1; }
|
||||||
|
static int GetFullTranslitTitle( T* p, lua_State *L ) { lua_pushstring(L, p->GetFullTranslitTitle() ); return 1; }
|
||||||
|
|
||||||
|
static void Register(lua_State *L)
|
||||||
|
{
|
||||||
|
ADD_METHOD( GetPlayMode )
|
||||||
|
ADD_METHOD( GetFullDisplayTitle )
|
||||||
|
ADD_METHOD( GetFullTranslitTitle )
|
||||||
|
Luna<T>::Register( L );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
LUA_REGISTER_CLASS( Course )
|
||||||
|
// lua end
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2001-2004 Chris Danford, Glenn Maynard
|
* (c) 2001-2004 Chris Danford, Glenn Maynard
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ struct SongOptions;
|
|||||||
class Song;
|
class Song;
|
||||||
class Steps;
|
class Steps;
|
||||||
class Profile;
|
class Profile;
|
||||||
|
struct lua_State;
|
||||||
|
|
||||||
enum CourseEntryType
|
enum CourseEntryType
|
||||||
{
|
{
|
||||||
@@ -153,6 +154,9 @@ public:
|
|||||||
|
|
||||||
const CourseEntry *FindFixedSong( const Song *pSong ) const;
|
const CourseEntry *FindFixedSong( const Song *pSong ) const;
|
||||||
|
|
||||||
|
// Lua
|
||||||
|
void PushSelf( lua_State *L );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) const;
|
bool GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) const;
|
||||||
bool GetTrailSorted( StepsType st, CourseDifficulty cd, Trail &trail ) const;
|
bool GetTrailSorted( StepsType st, CourseDifficulty cd, Trail &trail ) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user