Move Lua Bindings to the end for consistency.
This commit is contained in:
+40
-41
@@ -85,47 +85,7 @@ int CourseEntry::GetNumModChanges() const
|
|||||||
return iNumModChanges;
|
return iNumModChanges;
|
||||||
}
|
}
|
||||||
|
|
||||||
// lua start
|
|
||||||
#include "LuaBinding.h"
|
|
||||||
|
|
||||||
/** @brief Allow Lua to have access to the CourseEntry. */
|
|
||||||
class LunaCourseEntry: public Luna<CourseEntry>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static int GetSong( T* p, lua_State *L )
|
|
||||||
{
|
|
||||||
if( p->songID.ToSong() )
|
|
||||||
p->songID.ToSong()->PushSelf(L);
|
|
||||||
else
|
|
||||||
lua_pushnil(L);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
DEFINE_METHOD( IsSecret, bSecret );
|
|
||||||
DEFINE_METHOD( IsFixedSong, IsFixedSong() );
|
|
||||||
DEFINE_METHOD( GetGainSeconds, fGainSeconds );
|
|
||||||
DEFINE_METHOD( GetGainLives, iGainLives );
|
|
||||||
DEFINE_METHOD( GetNormalModifiers, sModifiers );
|
|
||||||
// GetTimedModifiers - table
|
|
||||||
DEFINE_METHOD( GetNumModChanges, GetNumModChanges() );
|
|
||||||
DEFINE_METHOD( GetTextDescription, GetTextDescription() );
|
|
||||||
|
|
||||||
LunaCourseEntry()
|
|
||||||
{
|
|
||||||
ADD_METHOD( GetSong );
|
|
||||||
// sm-ssc additions:
|
|
||||||
ADD_METHOD( IsSecret );
|
|
||||||
ADD_METHOD( IsFixedSong );
|
|
||||||
ADD_METHOD( GetGainSeconds );
|
|
||||||
ADD_METHOD( GetGainLives );
|
|
||||||
ADD_METHOD( GetNormalModifiers );
|
|
||||||
//ADD_METHOD( GetTimedModifiers );
|
|
||||||
ADD_METHOD( GetNumModChanges );
|
|
||||||
ADD_METHOD( GetTextDescription );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
LUA_REGISTER_CLASS( CourseEntry )
|
|
||||||
// lua end
|
|
||||||
|
|
||||||
|
|
||||||
Course::Course()
|
Course::Course()
|
||||||
@@ -1042,10 +1002,49 @@ bool Course::Matches( RString sGroup, RString sCourse ) const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// lua start
|
// lua start
|
||||||
#include "LuaBinding.h"
|
#include "LuaBinding.h"
|
||||||
|
|
||||||
|
/** @brief Allow Lua to have access to the CourseEntry. */
|
||||||
|
class LunaCourseEntry: public Luna<CourseEntry>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static int GetSong( T* p, lua_State *L )
|
||||||
|
{
|
||||||
|
if( p->songID.ToSong() )
|
||||||
|
p->songID.ToSong()->PushSelf(L);
|
||||||
|
else
|
||||||
|
lua_pushnil(L);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
DEFINE_METHOD( IsSecret, bSecret );
|
||||||
|
DEFINE_METHOD( IsFixedSong, IsFixedSong() );
|
||||||
|
DEFINE_METHOD( GetGainSeconds, fGainSeconds );
|
||||||
|
DEFINE_METHOD( GetGainLives, iGainLives );
|
||||||
|
DEFINE_METHOD( GetNormalModifiers, sModifiers );
|
||||||
|
// GetTimedModifiers - table
|
||||||
|
DEFINE_METHOD( GetNumModChanges, GetNumModChanges() );
|
||||||
|
DEFINE_METHOD( GetTextDescription, GetTextDescription() );
|
||||||
|
|
||||||
|
LunaCourseEntry()
|
||||||
|
{
|
||||||
|
ADD_METHOD( GetSong );
|
||||||
|
// sm-ssc additions:
|
||||||
|
ADD_METHOD( IsSecret );
|
||||||
|
ADD_METHOD( IsFixedSong );
|
||||||
|
ADD_METHOD( GetGainSeconds );
|
||||||
|
ADD_METHOD( GetGainLives );
|
||||||
|
ADD_METHOD( GetNormalModifiers );
|
||||||
|
//ADD_METHOD( GetTimedModifiers );
|
||||||
|
ADD_METHOD( GetNumModChanges );
|
||||||
|
ADD_METHOD( GetTextDescription );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
LUA_REGISTER_CLASS( CourseEntry )
|
||||||
|
|
||||||
|
// Not done with lua yet: still another class.
|
||||||
|
|
||||||
/** @brief Allow Lua to have access to the Course. */
|
/** @brief Allow Lua to have access to the Course. */
|
||||||
class LunaCourse: public Luna<Course>
|
class LunaCourse: public Luna<Course>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user